main_error

Crates.iomain_error
lib.rsmain_error
version0.1.2
sourcesrc
created_at2019-09-24 12:38:47.188144
updated_at2021-09-12 11:12:12.93155
descriptionPrint errors with Display instead of Debug when using ? in main().
homepage
repositoryhttps://github.com/danleh/main_error
max_upload_size
id167277
size9,381
Daniel Lehmann (danleh)

documentation

https://docs.rs/main_error/

README

main_error

Print errors with Display instead of Debug when using ? in main(). For example:

use main_error::MainError;

fn main() -> Result<(), MainError> {
    // This prints
    //   "Error: invalid digit found in string"
    // instead of (if you used `Result<(), Box<dyn Error>>` or similar)
    //   "ParseIntError { kind: InvalidDigit }".
    let number: i32 = "not a number".parse()?;

    Ok(())
}

For more info, see:

Commit count: 29

cargo fmt