derive_more
derive_more copied to clipboard
ParseError when implement Display derive for enum
Awesome library, i like it!
I found some small problems during use, in some cases, it will be panic. The following is an example:
#[derive(Display)]
#[display(fmt = "{_0}")]
enum NodeType {
Base(&'static str),
Main(&'static str),
N1(&'static str),
N2(&'static str),
N3(&'static str),
N4(&'static str),
}
Here is the compile error result:
error: proc-macro derive panicked
--> src/main.rs:93:10
|
93 | #[derive(Display)]
| ^^^^^^^
|
= help: message: called `Result::unwrap()` on an `Err` value: ParseError { line: 1, column: 2, offset: 1, expected: {"}", "[0-9]", ":"} }
I can't find the cause of the problem from the message.
@ilslv I guess this is not the case anymore on latest master
, but maybe you could add tests covering that, just to be sure?
@tyranron actually this case doesn't work on master
, but for a different reason: we haven't decided yet on how to implement affix https://github.com/JelteF/derive_more/issues/142