technocreatives / dbc-codegen

Generate Rust structs for messages from a dbc (CAN bus definition) file.
Apache License 2.0
43 stars 22 forks source link

Compile warnings unused and redundant imports #53

Closed wallem89 closed 1 month ago

wallem89 commented 1 year ago

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?