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`.
|
||||
pub fn wipe_date(date: &str) -> Result<()> {
|
||||
pub fn remove_by_date(date: &str) -> Result<()> {
|
||||
let base = get_base_path()?;
|
||||
for (_, file) in WalkDir::new(base)
|
||||
.into_iter()
|
||||
@ -461,8 +461,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn wipe_date_test() {
|
||||
assert!(wipe_date("1999-10-10").is_ok());
|
||||
fn remove_by_date_test() {
|
||||
assert!(remove_by_date("1999-10-10").is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -32,7 +32,7 @@ pub fn remove(matches: &ArgMatches) -> Result<()> {
|
||||
let date: String = Input::with_theme(&ColorfulTheme::default())
|
||||
.with_prompt("Date")
|
||||
.interact_text()?;
|
||||
notes::wipe_date(&date)?;
|
||||
notes::remove_by_date(&date)?;
|
||||
return Ok(());
|
||||
}
|
||||
false => {
|
||||
|
Loading…
Reference in New Issue
Block a user