error-gen

Crates.ioerror-gen
lib.rserror-gen
version0.1.0
sourcesrc
created_at2019-04-26 11:49:48.167285
updated_at2019-04-26 11:49:48.167285
descriptionSimple codegen for implementing `std::error::Error`
homepage
repositoryhttps://github.com/derekdreery/error-gen-rs
max_upload_size
id130313
size3,193
Richard Dodd (derekdreery)

documentation

README

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());
}
Commit count: 1

cargo fmt