diff options
author | Tomohito Nakayama <nkym.tmht@gmail.com> | 2019-09-16 03:48:25 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-09-15 14:48:25 -0400 |
commit | a93b29007f1b231fc2a5904d21e1fed354ff9e21 (patch) | |
tree | 3efb1193cdabb22eaedb8a0e23dcf5070badc839 /cli/diagnostics.rs | |
parent | 4556a38ed97c6e5fdeb1fab5ef07329d8285273c (diff) |
Rename ansi.rs to colors.rs (#2956)
Diffstat (limited to 'cli/diagnostics.rs')
-rw-r--r-- | cli/diagnostics.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index 14f5ba2c4..1e7c2b5eb 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. //! This module encodes TypeScript errors (diagnostics) into Rust structs and //! contains code for printing them to the console. -use crate::ansi; +use crate::colors; use crate::fmt_errors::format_maybe_source_line; use crate::fmt_errors::format_maybe_source_name; use crate::fmt_errors::DisplayFormatter; @@ -183,7 +183,7 @@ impl DisplayFormatter for DiagnosticItem { fn format_category_and_code(&self) -> String { let category = match self.category { DiagnosticCategory::Error => { - format!("{}", ansi::red_bold("error".to_string())) + format!("{}", colors::red_bold("error".to_string())) } DiagnosticCategory::Warning => "warn".to_string(), DiagnosticCategory::Debug => "debug".to_string(), @@ -191,7 +191,8 @@ impl DisplayFormatter for DiagnosticItem { _ => "".to_string(), }; - let code = ansi::bold(format!(" TS{}", self.code.to_string())).to_string(); + let code = + colors::bold(format!(" TS{}", self.code.to_string())).to_string(); format!("{}{}: ", category, code) } @@ -340,7 +341,7 @@ impl From<i64> for DiagnosticCategory { #[cfg(test)] mod tests { use super::*; - use crate::ansi::strip_ansi_codes; + use crate::colors::strip_ansi_codes; fn diagnostic1() -> Diagnostic { Diagnostic { |