summaryrefslogtreecommitdiff
path: root/runtime/colors.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2021-03-26 12:34:25 -0400
committerGitHub <noreply@github.com>2021-03-26 12:34:25 -0400
commitf46e39c5c5435696daab9df075482e6e5c83533b (patch)
tree7699e06977e1149b5d056739f981c0217a91ed5e /runtime/colors.rs
parent6c6f3e87c1a60bc96d006812a670212eeacd1257 (diff)
remove macro_use (#9884)
Diffstat (limited to 'runtime/colors.rs')
-rw-r--r--runtime/colors.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/runtime/colors.rs b/runtime/colors.rs
index ac4643a0c..6d020bb6d 100644
--- a/runtime/colors.rs
+++ b/runtime/colors.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use regex::Regex;
use std::env;
use std::fmt;
@@ -10,15 +9,13 @@ use termcolor::{Ansi, ColorSpec, WriteColor};
#[cfg(windows)]
use termcolor::{BufferWriter, ColorChoice};
-lazy_static! {
- // STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate.
- // Copyright 2017 Armin Ronacher <armin.ronacher@active-4.com>. MIT License.
- static ref STRIP_ANSI_RE: Regex = Regex::new(
- r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"
- ).unwrap();
- static ref NO_COLOR: bool = {
- env::var_os("NO_COLOR").is_some()
- };
+lazy_static::lazy_static! {
+ // STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate.
+ // Copyright 2017 Armin Ronacher <armin.ronacher@active-4.com>. MIT License.
+ static ref STRIP_ANSI_RE: Regex = Regex::new(
+ r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"
+ ).unwrap();
+ static ref NO_COLOR: bool = env::var_os("NO_COLOR").is_some();
}
/// Helper function to strip ansi codes.