Repository navigation
chore(lint): enable clippy::map_err_ignore - #22
Merged
Merged
Conversation
Forbid .map_err(|_| ...), which silently discards the original error instead of binding it. This crate does network requests, checksum verification, and archive extraction — all failure-prone operations where the underlying error is exactly what's needed to debug a failed install. No existing call sites were affected: a clippy scan of lib/src showed zero .map_err(|_| ...) usages, so this only guards future code. Closes #20 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Enables
clippy::map_err_ignore(a restriction-group lint) asdenyinlib/Cargo.tomlunder[lints.clippy]. This lint flags.map_err(|_| ...), which silently discards the original error instead of binding it.centy-installerdoes network requests (reqwest), checksum verification, and archive extraction (tar/zip) — all failure-prone operations where the underlying error is exactly what a user or maintainer needs to debug a failed install. Enabling this lint forces every error-mapping closure to bind the source error (.map_err(|e| ...)) so it can be logged, wrapped, or otherwise preserved going forward.There is no workspace-level
Cargo.tomlin this repo (onlylib/Cargo.toml), so the lint was added directly tolib/Cargo.toml's existing[lints.clippy]table, matching its established style (onedeny-with-comment per entry).Closes #20
Validation
A scan of
lib/srcconfirmed zero pre-existing.map_err(|_| ...)call sites, so no code fixups were needed. After enabling the lint:cargo build— passescargo test(unit + e2e, e2e run single-threaded per the test file's own instructions to avoid a pre-existing shared-binary-path race) — 63 unit tests + 4 e2e tests all passcargo clippy --all-targets— zero warnings/errorsThis pull request was opened by the Open issues → fix PRs (owned repos + my orgs) routine of moadim.