chore(lint): clear the two clippy failures on a current toolchain #489
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/clippy-current-toolchain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two mechanical lint fixes, no behaviour change. Flagged on #485, #486, #487 and #488 and split out rather than smuggled into a feature branch.
Why now
just check-clippyfails on unmodifiedmainwith a clippy newer than the one CI currently runs. CI is green today only because of that version gap, so the repo is one runner upgrade away from a red Check that has nothing to do with whatever change is under review. That is the kind of failure people learn to wave through, which is worth avoiding on a gate that exists to be believed.The changes
src/pages/projects.rs(manual_div_ceil). The explicitif total_tasks > 0guard becomeschecked_div, which returns None on a zero divisor and therefore gives the same "no tasks means no progress" answer.src/pages/time.rs(unnecessary_sort_by).sort_by(|a, b| a.at.cmp(&b.at))becomessort_by_key(|e| e.at).atis aDateTime<Utc>, which isCopy, so there is no clone, and both sorts are stable, so the comment directly above about equal timestamps keeping insertion order still holds.Verification
cargo clippy --all-targets -- -D warningsnow passes cleanly, which it did not before this branch. Pluscargo check --target wasm32-unknown-unknown,cargo fmt --all --check,cargo test(261 passed, 0 failed), and both guard scripts.