#![deny(
dead_code,
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
use std::env;
const ENV_VAR_NO_COLOR: &str = "NO_COLOR";
pub fn is_no_color() -> bool {
env::var_os(ENV_VAR_NO_COLOR).is_some()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_env_var_no_color_true_with_value() {
env::set_var(ENV_VAR_NO_COLOR, "1");
assert!(is_no_color(), true);
}
#[test]
fn test_env_var_no_color_true_without_value() {
env::set_var(ENV_VAR_NO_COLOR, "");
assert!(is_no_color(), true);
}
}