diff options
Diffstat (limited to 'src/reports/source_hierarchy.rs')
-rw-r--r-- | src/reports/source_hierarchy.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/reports/source_hierarchy.rs b/src/reports/source_hierarchy.rs index 2e88a77..f391785 100644 --- a/src/reports/source_hierarchy.rs +++ b/src/reports/source_hierarchy.rs @@ -7,7 +7,7 @@ pub struct SourceHierarchy<'a> { impl<'a> SourceHierarchy<'a> { pub fn report(&self) { - eprintln!("."); + ink!(".").eprintln(); let len = self.resolver.root_unit_ids.len(); for (i, id) in self.resolver.root_unit_ids.iter().enumerate() { let end = i + 1 == len; @@ -19,29 +19,29 @@ impl<'a> SourceHierarchy<'a> { // A level entry is true if all entries in that level have been printed. for level in &levels { match level { - false => eprint!("│ "), - true => eprint!(" "), + false => ink!("│ ").eprint(), + true => ink!(" ").eprint(), } } // The end value is true if all siblings of this entry have been printed. match end { - false => eprint!("├── "), - true => eprint!("└── "), + false => ink!("├── ").eprint(), + true => ink!("└── ").eprint(), } let unit = &self.resolver.source_units[id]; let path_str = &unit.source_unit.main.path.as_os_str().to_string_lossy(); if let Some(name_str) = unit.source_unit.name() { - eprint!("{name_str}{BLUE}"); - if unit.source_unit.head.is_some() { eprint!(" +head") } - if unit.source_unit.tail.is_some() { eprint!(" +tail") } + ink!("{name_str}").eprint(); + if unit.source_unit.head.is_some() { ink!(" +head").blue().eprint() } + if unit.source_unit.tail.is_some() { ink!(" +tail").blue().eprint() } let mut unresolved = 0; for symbol in &self.resolver.unresolved { if symbol.source_id == id { unresolved += 1; } } - if unresolved > 0 { eprint!("{RED} ({unresolved})"); } - eprintln!("{NORMAL} {DIM}({path_str}){NORMAL}"); + if unresolved > 0 { ink!(" ({unresolved})").red().eprint(); } + ink!(" ({path_str})").dim().eprintln(); } else { - eprintln!("{path_str}"); + ink!("{path_str}").eprintln(); } levels.push(end); let len = unit.child_ids.len(); |