Skip to content

chore(lint): enable clippy::map_err_ignore - #22

Merged
tupe12334 merged 1 commit into
mainfrom
fix/issue-20-clippy-map-err-ignore
Jul 2, 2026
Merged

tupe12334 merged 1 commit into
mainfrom
fix/issue-20-clippy-map-err-ignore

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Summary

Enables clippy::map_err_ignore (a restriction-group lint) as deny in lib/Cargo.toml under [lints.clippy]. This lint flags .map_err(|_| ...), which silently discards the original error instead of binding it.

centy-installer does 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.toml in this repo (only lib/Cargo.toml), so the lint was added directly to lib/Cargo.toml's existing [lints.clippy] table, matching its established style (one deny-with-comment per entry).

Closes #20

Validation

A scan of lib/src confirmed zero pre-existing .map_err(|_| ...) call sites, so no code fixups were needed. After enabling the lint:

  • cargo build — passes
  • cargo 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 pass
  • cargo clippy --all-targets — zero warnings/errors

This pull request was opened by the Open issues → fix PRs (owned repos + my orgs) routine of moadim.

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>
@tupe12334
tupe12334 merged commit 47fa763 into main Jul 2, 2026
2 checks passed
@tupe12334
tupe12334 deleted the fix/issue-20-clippy-map-err-ignore branch July 2, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable clippy::map_err_ignore lint

1 participant