cleaner representation of index

This commit is contained in:
aaron-jack-manning
2022-08-25 10:44:22 +10:00
parent 0083c51418
commit bc602c4d34
7 changed files with 128 additions and 87 deletions

View File

@@ -81,8 +81,8 @@ pub fn edit_raw(id : Id, vault_folder : path::PathBuf, editor : &str, state : &m
}
// Name change means index needs to be updated.
if edited_task.data.name != task.data.name {
state.index_remove(task.data.name.clone(), id);
state.index_insert(edited_task.data.name.clone(), id);
state.data.index.remove(task.data.name.clone(), id);
state.data.index.insert(edited_task.data.name.clone(), id);
}
mem::swap(&mut edited_task.data, &mut task.data);