dcSpark/cddl-codegen

Unused imports in generated code

rooooooooob opened this issue · 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

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

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

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