quick-error
quick-error copied to clipboard
A rust-macro which makes errors easy to write
I just discovered that this isn't possible: ``` quick_error! { pub enum MyFancyError { Foo(e: E) { } } } ``` Which is a shame, because this would be very...
Are you planning to add support for plain structs, rather than just enums?
``` :192:1: 197:60 error: recursion limit reached while expanding the macro `quick_error :192 quick_error ! ( :193 ENUM_DEFINITION [ $ ( $ def ) * ] body [ :194 $...
Currently I have code that looks like this: ``` quick_error! { #[derive(Debug)] pub enum ServerError { Io(error: io::Error) { display("{}", error) description(error.description()) cause(error) from() } JsonDecode(error: json::DecoderError) { display("{}", error)...
In https://github.com/gkoz/gir/blob/master/src/config.rs we use this enum for error of configuration processing: ``` #[derive(Debug)] pub enum Error { CommandLine(DocoptError), Io(IoError, PathBuf), Toml(String, PathBuf), Options(String, PathBuf), } ``` Last 3 errors here...
**Observation**: The main pain point of enums is the repetitiveness of match-statements. Which are scattered around at different locations. This is good for adding and removing a new trait implementation...
This crate already uses fully safe code so this PR adds an annotation enforcing that at compile time. Looking for #![forbid(unsafe_code)] is more reliable than trying to grep the crate...
GitHub redirects to the address with https anyway, so let's put that in Cargo.toml See also https://github.com/szabgab/rust-digger/issues/97