custom_error
custom_error copied to clipboard
Allow braketless structs
This issue is tangentially related to #30, but should hopefully be easier to decide and implement. Also CC #17 since that is the PR introducing enum structs.
Currently the macro supports this syntax:
custom_error::custom_error! {
pub MyError{} = "error message"
}
But does not support this syntax:
custom_error::custom_error! {
pub MyError = "error message"
}
Which is used somewhat frequently in my current codebase.
Is there plans to support this type of structs? For reference, the first (currently-supported) syntax corresponds to:
pub struct MyError{}
// derive Debug, Error, Display
Whereas the second (proposed) syntax corresponds to:
pub struct MyError;
// derive Debug, Error, Display