olafurw / poke-fighting-rust

Application that simulates a large grid of Pokémon types fighting each other.
24 stars 3 forks source link

Cleaned up imports #12

Closed palant closed 2 years ago

palant commented 2 years ago

See https://rust-lang.github.io/rust-clippy/master/#wildcard_imports for recommendations on imports. This rule isn’t enforced by default but running cargo clippy -- -W clippy::wildcard_imports will make the warnings show up. In general, importing stuff in main.rs that isn’t used there but is transitively imported elsewhere is very confusing. Also, use super::* in tests usually takes care of all import needs.

palant commented 2 years ago

In fact, I also removed the wildcard import for nannou::prelude even though it would be allowed by that clippy rule. That prelude defines way too much stuff, and constants like PURPLE or namespaces like wgpu popping up out of nowhere certainly doesn’t help understanding the code.