rerun-io / rerun

Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui.
https://rerun.io/
Apache License 2.0
5.33k stars 245 forks source link

Enable `clippy::iter_over_hash_type` lint #6198

Open emilk opened 2 weeks ago

emilk commented 2 weeks ago

Iterating over HashMap and HashSet causes a lot of bugs in our UI.

We should fix it where it makes sense, and loudly comment/name things as unsorted or similar when we want the performance (see CODE_STYLE.md).

There are currently 51 violations of this lint

❯ cargo clippy  2>&1 | rg 'iteration over unordered hash-based type' | wc -l
      51

Note that this lint doesn't catch everything. For instance, this code generates no warnings:

https://github.com/rerun-io/rerun/blob/0ac38a4df54c45f2c34f6a75c6044f9785719615/crates/re_entity_db/src/store_bundle.rs#L43-L46