diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2021-03-26 12:34:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-26 12:34:25 -0400 |
commit | f46e39c5c5435696daab9df075482e6e5c83533b (patch) | |
tree | 7699e06977e1149b5d056739f981c0217a91ed5e /cli/colors.rs | |
parent | 6c6f3e87c1a60bc96d006812a670212eeacd1257 (diff) |
remove macro_use (#9884)
Diffstat (limited to 'cli/colors.rs')
-rw-r--r-- | cli/colors.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/colors.rs b/cli/colors.rs index 278c141b4..5eafef4d4 100644 --- a/cli/colors.rs +++ b/cli/colors.rs @@ -4,7 +4,6 @@ #![allow(dead_code)] use regex::Regex; -use std::env; use std::fmt; use std::io::Write; use termcolor::Color::{Ansi256, Black, Blue, Cyan, Green, Red, White, Yellow}; @@ -13,14 +12,14 @@ use termcolor::{Ansi, ColorSpec, WriteColor}; #[cfg(windows)] use termcolor::{BufferWriter, ColorChoice}; -lazy_static! { +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() + std::env::var_os("NO_COLOR").is_some() }; } |