Skip to content

Commit 7062177

Browse files
committed
backward compatible env var assessment
fmt
1 parent 0538c0c commit 7062177

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp-linter/src/logger.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ impl log::Log for SimpleLogger {
4949
/// Returns a [`SetLoggerError`] if the `LOGGER` is already initialized.
5050
pub fn init() -> Result<()> {
5151
let logger: SimpleLogger = SimpleLogger;
52-
if env::var("CPP_LINTER_COLOR").is_ok_and(|v| ["on", "1", "true"].contains(&v.as_str())) {
52+
if matches!(
53+
env::var("CPP_LINTER_COLOR").as_deref(),
54+
Ok("on" | "1" | "true")
55+
) {
5356
set_override(true);
5457
}
5558
log::set_boxed_logger(Box::new(logger))

0 commit comments

Comments
 (0)