dbc-codegen icon indicating copy to clipboard operation
dbc-codegen copied to clipboard

Compile warnings unused and redundant imports

Open wallem89 opened this issue 1 year ago • 0 comments

When compiling the generated messages.rs I get two warning:

warning: unused import: `core::ops::BitOr`
  --> src/messages.rs:11:5
   |
11 | use core::ops::BitOr;
   |     ^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

and

warning: the item `TryFrom` is imported redundantly
   --> src/messages.rs:30:13
    |
30  |         use core::convert::TryFrom;
    |             ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0433`.

I can off course remove these two lines or comment them out but that is not the idea of a generated file. I guess they are in some cases but apparently not in all cases. Would it be possible to only add them when actually used?

wallem89 avatar Mar 24 '23 13:03 wallem89