rename "wipe_date" by "remove_by_date"
This commit is contained in:
parent
ae702b76cf
commit
9430b40cf3
@ -379,7 +379,7 @@ pub fn list_category(category: &str) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Remove all notes created at the given date in format `YYYY-MM-dd`.
|
/// Remove all notes created at the given date in format `YYYY-MM-dd`.
|
||||||
pub fn wipe_date(date: &str) -> Result<()> {
|
pub fn remove_by_date(date: &str) -> Result<()> {
|
||||||
let base = get_base_path()?;
|
let base = get_base_path()?;
|
||||||
for (_, file) in WalkDir::new(base)
|
for (_, file) in WalkDir::new(base)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@ -461,8 +461,8 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
fn wipe_date_test() {
|
fn remove_by_date_test() {
|
||||||
assert!(wipe_date("1999-10-10").is_ok());
|
assert!(remove_by_date("1999-10-10").is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -32,7 +32,7 @@ pub fn remove(matches: &ArgMatches) -> Result<()> {
|
|||||||
let date: String = Input::with_theme(&ColorfulTheme::default())
|
let date: String = Input::with_theme(&ColorfulTheme::default())
|
||||||
.with_prompt("Date")
|
.with_prompt("Date")
|
||||||
.interact_text()?;
|
.interact_text()?;
|
||||||
notes::wipe_date(&date)?;
|
notes::remove_by_date(&date)?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
false => {
|
false => {
|
||||||
|
Loading…
Reference in New Issue
Block a user