eyre-rs / color-eyre

Custom hooks for colorful human oriented error reports via panics and the eyre crate
Other
961 stars 56 forks source link

the cat could not got be got #89

Closed samusz closed 2 years ago

samusz commented 3 years ago

Hi,

in your RustConf you showed this example: `

fn main() -> Result<(), eyre::Report> { color_eyre::install()?;

let _ = std::process::Command::new("git")
    .arg("cat")
    .output2()
    .wrap_err("The cat couldnot be got")?;

Ok(())

} ` But I couldn't get it to work.

I tried different use statements but failed to get the .output2() working.

Sorry if this issue isn't really one. Help much appreciated on this fun example.

yaahc commented 3 years ago

The output2 method is from a trait that was being implemented during the talk as an example, not a trait that is part of color-eyre.

I've implemented similar traits in the past in projects I've worked on such as https://github.com/ZcashFoundation/zebra/blob/main/zebra-test/src/command.rs#L30 if you'd like an example you can work off of.