use crate::common::*; pub(crate) trait ErrorResultExt { fn eprint(self, color: Color) -> Result; } impl ErrorResultExt for Result { fn eprint(self, color: Color) -> Result { match self { Ok(ok) => Ok(ok), Err(error) => { if color.stderr().active() { eprintln!("{}: {:#}", color.stderr().error().paint("error"), error); } else { eprintln!("error: {}", error); } Err(error.code()) } } } }