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

Unused imports in generated code

Open rooooooooob opened this issue 2 years ago • 3 comments

We blindly import various things in some places for simplicity's sake in the code generation.

Some have been fixed in #137 but others remain:

[] prelude::* in lib.rs [] crate::cbor_encodings::* in serialize.rs [] super::* in serialize.rs [] super::* in cbor_encodings.rs [] OrderedHashMap / BTreeMap in every struct file, regardless of if needed

rooooooooob avatar Feb 08 '23 05:02 rooooooooob

The remaining ones are probably lower priority as most are just an issue of removing a single line from files after generation.

rooooooooob avatar Feb 08 '23 05:02 rooooooooob

This isn't that bad I think. Probably we can use something like rustfmt to just delete unused imports after the codegen runs

SebastienGllmt avatar Feb 08 '23 06:02 SebastienGllmt

we can run cargo clippy --fix as well so there're less warnings

gostkin avatar Feb 08 '23 16:02 gostkin