mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
misc improvements
This commit is contained in:
parent
c47fff04d2
commit
f620508a37
6 changed files with 14 additions and 46 deletions
|
@ -27,12 +27,13 @@ impl Problems {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn print_to_stdout(&self, total_time: std::time::Duration) {
|
||||
// prints e.g. `1 error and 0 warnings found in 63 ms.`
|
||||
pub fn print_error_warning_count(&self, total_time: std::time::Duration) {
|
||||
const GREEN: &str = ANSI_STYLE_CODES.green;
|
||||
const YELLOW: &str = ANSI_STYLE_CODES.yellow;
|
||||
|
||||
print!(
|
||||
"{}{}\x1B[39m {} and {}{}\x1B[39m {} found in {} ms\n",
|
||||
println!(
|
||||
"{}{}\x1B[39m {} and {}{}\x1B[39m {} found in {} ms",
|
||||
match self.errors {
|
||||
0 => GREEN,
|
||||
_ => YELLOW,
|
||||
|
@ -56,39 +57,6 @@ impl Problems {
|
|||
}
|
||||
}
|
||||
|
||||
// prints e.g. `1 error and 0 warnings found in 63 ms.`
|
||||
pub fn print_error_warning_count(
|
||||
error_count: usize,
|
||||
warning_count: usize,
|
||||
total_time: std::time::Duration,
|
||||
) {
|
||||
const GREEN: &str = ANSI_STYLE_CODES.green;
|
||||
const YELLOW: &str = ANSI_STYLE_CODES.yellow;
|
||||
|
||||
print!(
|
||||
"{}{}\x1B[39m {} and {}{}\x1B[39m {} found in {} ms",
|
||||
match error_count {
|
||||
0 => GREEN,
|
||||
_ => YELLOW,
|
||||
},
|
||||
error_count,
|
||||
match error_count {
|
||||
1 => "error",
|
||||
_ => "errors",
|
||||
},
|
||||
match warning_count {
|
||||
0 => GREEN,
|
||||
_ => YELLOW,
|
||||
},
|
||||
warning_count,
|
||||
match warning_count {
|
||||
1 => "warning",
|
||||
_ => "warnings",
|
||||
},
|
||||
total_time.as_millis()
|
||||
);
|
||||
}
|
||||
|
||||
pub fn report_problems(
|
||||
sources: &MutMap<ModuleId, (PathBuf, Box<str>)>,
|
||||
interns: &Interns,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue