//! Small helpers. `redact_path` replaces the home dir with `~` so no error or
//! status line leaks a username.
pubfnredact_path(s:&str)-> String{ifletSome(home)=dirs::home_dir(){let home = home.to_string_lossy();if!home.is_empty(){return s.replace(home.as_ref(),"~");}}
s.to_string()}/// ANSI colour is used only on a TTY and never when NO_COLOR is set
/// (https://no-color.org).
pubfncolor_enabled()->bool{usestd::io::IsTerminal;std::io::stdout().is_terminal()&&std::env::var_os("NO_COLOR").is_none()}