moved the enforcing of some invariants to be done on save

This commit is contained in:
aaron-jack-manning
2022-09-10 16:14:05 +10:00
parent 5bb20e6166
commit 5361ea4630
4 changed files with 37 additions and 40 deletions

View File

@@ -119,8 +119,8 @@ fn program() -> Result<(), error::Error> {
match command {
Command::New { name, info, tag, dependency, priority, due } => {
let task = tasks::Task::new(name, info, tag, dependency, priority, due, vault_folder, &mut state)?;
println!("Created task {} (ID: {})", format::task(&task.data.name), format::id(task.data.id));
let id = tasks::Task::new(name.clone(), info, tag, dependency, priority, due, vault_folder, &mut state)?;
println!("Created task {} (ID: {})", format::task(&name), format::id(id));
},
Command::Delete { id_or_name } => {
let id = state.data.index.lookup(&id_or_name)?;