cemoktra/ice-rs

Add #[allow(non_camel_case_types)] to enums

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
We are working on porting an existing codebase to rust. Our ice interface looks like this

    enum MessageType { eUNDEFINED, eDEBUG, eVERBOSE, eINFO, eIMPORTANT, eWARN, eERROR, eFATAL, eLogLevelCount };

    struct LogMessage{
        string who;
        long time;
        string group;
        string tag;
        MessageType type;
        string what;
        string file;
        int line;
        string function;
        string backtrace;
        int threadId;

    };

This generates a lot of warnings like this

warning: variant `eUNDEFINED` should have an upper camel case name
  --> src/gen/armarx/mod.rs:18:5
   |
18 |     eUNDEFINED = 0i32,
   |     ^^^^^^^^^^ help: convert the identifier to upper camel case: `EUndefined`
   |
   = note: `#[warn(non_camel_case_types)]` on by default

Describe the solution you'd like
Adding #[allow(non_camel_case_types)] in front of enums supresses this warning.

Describe alternatives you've considered
I added it manually, but this is not a feasible solution.

Hi,

i kind of abandoned this project as my company moved away from ice