Use var_os to avoid conversion to String

This commit is contained in:
mo8it 2024-03-31 20:11:08 +02:00
parent 7560aec66b
commit 8ad18de54c

View file

@ -3,7 +3,7 @@ macro_rules! print_emoji {
use console::{style, Emoji}; use console::{style, Emoji};
use std::env; use std::env;
let formatstr = format!($fmt, $ex); let formatstr = format!($fmt, $ex);
if env::var("NO_EMOJI").is_ok() { if env::var_os("NO_EMOJI").is_some() {
println!("{} {}", style($sign).$color(), style(formatstr).$color()); println!("{} {}", style($sign).$color(), style(formatstr).$color());
} else { } else {
println!( println!(