colors: drop libc invocations for var_os

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I572acd49ef687c8049d43a7ba42bd12c6a6a6964
This commit is contained in:
raf 2026-03-25 15:55:24 +03:00
commit 90ba703506
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -37,8 +37,8 @@ impl Colors {
}
pub static COLORS: LazyLock<Colors> = LazyLock::new(|| {
const NO_COLOR: *const libc::c_char = c"NO_COLOR".as_ptr();
let is_no_color = unsafe { !libc::getenv(NO_COLOR).is_null() };
// Only presence matters; value is irrelevant per the NO_COLOR spec
let is_no_color = std::env::var_os("NO_COLOR").is_some();
Colors::new(is_no_color)
});