1 unstable release

0.1.0 Apr 26, 2019

#13 in #impls


Used in read-human

Apache-2.0/MIT

3KB

Currently a very simple crate to generate error impls from unit structs.

Examples

use error_gen::ErrorGen;

#[derive(Debug, ErrorGen)]
pub struct MyError;

fn main() {
    let e = MyError;
    assert_eq!(e.to_string(), "my error");
    assert!(std::error::Error::source(e).is_none());
}

Dependencies

~2.5MB
~54K SLoC