custom_error icon indicating copy to clipboard operation
custom_error copied to clipboard

Allow braketless structs

Open RuijieYu opened this issue 3 years ago • 0 comments

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

RuijieYu avatar Jul 11 '22 21:07 RuijieYu