fn main() -> Result<()> {
color_eyre::install()?;
let now = Instant::now();
let _ = eyre::eyre!("one");
println!("first error: {:?}", Instant::now() - now);
let now = Instant::now();
let _ = eyre::eyre!("two");
println!("second error: {:?}", Instant::now() - now);
Ok(())
}
cargo run --release gives
first error: 6.476077ms
second error: 35.841µs
Getting rid of the color_eyre::install() call or not setting RUST_BACKTRACE gets rid of this behavior. This bit me because I'm writing a music player and the decoder library I'm using signals EOF by constructing an Err, so I wind up underflowing my buffer on the first EOF I got. I can work around this by just constructing and throwing away an err variant; if this isn't fixable, IMO it should be documented.
With color-eyre 0.6.2 and
RUST_BACKTRACE=1
cargo run --release
givesGetting rid of the
color_eyre::install()
call or not settingRUST_BACKTRACE
gets rid of this behavior. This bit me because I'm writing a music player and the decoder library I'm using signals EOF by constructing anErr
, so I wind up underflowing my buffer on the first EOF I got. I can work around this by just constructing and throwing away an err variant; if this isn't fixable, IMO it should be documented.