fix(shared-context): clear pre-existing clippy -D warnings debt (item B)#149
Merged
Conversation
~20 mechanical clippy lib lints in `gitbot-shared-context`, all fixed
idiomatically with no API/behaviour change (verified: build + clippy
--lib --tests --bins -D warnings clean + 84 tests pass):
- context.rs: drop unused `Severity` import; derive `Default` for
ContextConfig instead of hand-impl.
- reporting.rs: trim unused imports (move test-only `BotId` into the
test module); `push('\n')`; iterate map `.values()`.
- storage.rs: drop unused `SessionState`; collapse nested ifs;
`sort_by_key(Reverse(..))`; `#[cfg(test)] Default for MemoryStorage`;
`#[allow(should_implement_trait)]` + rationale on fallible `default()`.
- bot.rs: `#[allow(should_implement_trait)]` + rationale on
`from_str` -> Option; remove if/else with identical blocks.
- exclusion_registry.rs: implement real `std::str::FromStr`
(signature-compatible) + update call sites to `.parse()`;
`if let Ok(..) = env::var(..)`; collapse nested if.
- registry_guard.rs: collapse nested if; manual `split_once`.
Scope strictly shared-context/src/; benches/ untouched (handled in
#145). Disjoint from #145 — independent PR for separate review.
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Clears the ~20 pre-existing
cargo clippy --all-targets -- -D warningslib lints ingitbot-shared-context(item B / broader fleet CI health). All mechanical, idiomatic, no public API or behaviour change.Verified from
shared-context/:cargo buildclean,cargo clippy --lib --tests --bins -- -D warningszero warnings,cargo test84 passed / 0 failed.Scope is strictly
shared-context/src/(6 files).shared-context/benches/is deliberately untouched (itscriterion::black_boxdeprecation is handled within #145). Fully disjoint from #145 — separate PR for independent review.Refs hyperpolymath/hypatia#252
🤖 Generated with Claude Code