colours and formatting fixes

This commit is contained in:
aaron-jack-manning
2022-08-29 19:38:21 +10:00
parent c547fb8997
commit 93fa52611a
9 changed files with 240 additions and 155 deletions

View File

@@ -40,7 +40,7 @@ impl Graph {
Err(error::Error::Internal(String::from("Attempt to insert an edge in the dependency graph with a node which wasn't present")))
}
else if first == second {
Err(error::Error::Generic(format!("Note with ID {} cannot depend on itself", colour::id(first))))
Err(error::Error::Generic(format!("Note with ID {} cannot depend on itself", colour::text::id(first))))
}
else {
let outgoing = self.edges.get_mut(&first).unwrap();
@@ -136,7 +136,7 @@ pub fn format_cycle(cycle : &Vec<Id>) -> String {
let mut formatted = String::new();
for (index, node) in cycle.iter().enumerate() {
write!(&mut formatted, "{}", colour::id(*node)).unwrap();
write!(&mut formatted, "{}", colour::text::id(*node)).unwrap();
if index != cycle.len() - 1 {
formatted.push_str(" -> ");