dependency tracking; code cleanup; removed option to discard; move to

trash rather than delete
This commit is contained in:
aaron-jack-manning
2022-08-25 16:40:56 +10:00
parent bc602c4d34
commit 170dbdcc2c
12 changed files with 287 additions and 110 deletions

View File

@@ -1,6 +1,7 @@
use crate::error;
use crate::tasks;
use crate::index;
use crate::graph;
use crate::tasks::Id;
use std::fs;
@@ -18,6 +19,7 @@ pub struct State {
pub struct InternalState {
pub next_id : Id,
pub index : index::Index,
pub deps : graph::Graph,
}
impl State {
@@ -52,14 +54,15 @@ impl State {
}
}
// Calculating out the index.
// Calculating out the index and graph.
let tasks = tasks::Task::load_all(vault_location, true)?;
let index = index::Index::create(&tasks);
let deps = graph::Graph::create(tasks);
let data = InternalState {
next_id : u64::try_from(max_id + 1).unwrap(),
index,
deps,
};
let mut file = fs::File::options()