Crates.io | error-gen |
lib.rs | error-gen |
version | 0.1.0 |
source | src |
created_at | 2019-04-26 11:49:48.167285 |
updated_at | 2019-04-26 11:49:48.167285 |
description | Simple codegen for implementing `std::error::Error` |
homepage | |
repository | https://github.com/derekdreery/error-gen-rs |
max_upload_size | |
id | 130313 |
size | 3,193 |
Currently a very simple crate to generate error impls from unit structs.
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());
}