not-fl3 / nanoserde

Serialisation library with zero dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enums without a trailing comma generate error

lucaxxmiglia opened this issue · comments

An Enum without a trailing comma (which is a good practice but not mandatory in Rust syntax) generate an error.
This declaration:

#[derive(DeRon)]
enum MyEnum {
    A,
    B,
    C
}

results in:


error: proc-macro derive panicked
  --> src/main.rs:10:10
   |
10 | #[derive(DeRon)]
   |          ^^^^^
   |
   = help: message: not implemented: Unexpected type in enum: Type { ident: UnNamed, wraps: None, ref_type: None, as_other: None }

while this works fine:

#[derive(DeRon)]
enum MyEnum {
    A,
    B,
    C,
}

Tested only with DeRon and DeJson, error in both.

Thanks for filing an issue, have a PR open to fix this now