refactor: replace global clippy::pedantic allows with local annotations#79
Merged
Merged
Conversation
Remove seven blanket allows from Cargo.toml [lints.clippy] and address each remaining warning either at the source (preferred) or with a local #[allow(...)] carrying a reason= annotation that documents why the cast or derive is safe at that site. Source-level fixes: - utils::clipboard_files: keep percent-decoding in u8 end-to-end via a new hex_digit_value helper, eliminating the u32 -> u8 cast. - updater::models: derive Eq on ReleaseInfo (UpdateStatus stays PartialEq because it carries an f32 progress value). - gui::board::records_list::metrics: introduce GRID_COLUMN_COUNT_F32 mirror constant so masonry layout math no longer casts at runtime. Refs #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace seven blanket
clippy::pedanticallows inCargo.tomlwith localized#[allow(...)]annotations (each carrying areason = "..."), and remove a few warnings entirely at the source. After this changecargo clippy --all-targets --all-features -- -D warningsis clean.Linked Issue
Closes #78
Changes
Cargo.toml— drop the seven globalclippy::pedanticallows so future code is lint-checked again.#[allow]left behind):utils::clipboard_files— newhex_digit_value(u8) -> Option<u8>helper keeps percent-decoding inu8end-to-end, eliminating theu32 -> u8cast and the misleadingtry_fromclippy suggestion.updater::models— deriveEqonReleaseInfo(UpdateStatuskeepsPartialEqonly because it carries anf32progress value).gui::board::records_list::metrics— addGRID_COLUMN_COUNT_F32mirror constant so masonry layout math no longer casts at runtime.#[allow(... reason = "...")]for the remaining warnings, each documenting the safety invariant at that exact site:gui::board::color—parse_alphaandfloat_channel_to_u8are guarded to[0.0, 1.0]before scaling tou8.gui::board::preview— image dimensions from theimagecrate fit comfortably inf32.gui::board::records_list::metrics/masonry— line counts and column indices are bounded by small compile-time constants.gui::board::settings_editor— opacity slider is bounded byMIN/MAX_OPACITY_PERCENT(0..=100).gui::utils— physical pixel sizes fit ini32on every supported platform.updater::downloader— download progress only needs sub-percent accuracy.gui::board::actions—gpui::actions!macro can't haveEqinjected from outside; the generated items are wrapped in a private submodule scoped with#[allow(derive_partial_eq_without_eq)]and re-exported, so external usage is unchanged.repository::time_index(tests only) — module-level allow for cast lints over small loop indices used in test fixtures.Testing
scripts/precheck.shpasses locally (cargo fmt,cargo check,cargo clippy -- -D warnings,cargo test421 passed,cargo machete, i18n / icons / themes checks)