Repository navigation
Remove unused code lint from allow list - #291
Merged
FalkWoldmann merged 3 commits intoSep 29, 2026
Merged
FalkWoldmann merged 3 commits into
FalkWoldmann merged 3 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
danieleades
force-pushed
the
claude/remove-unused-code-lint-b2f0he
branch
from
August 17, 2026 18:54
330967a to
d36005c
Compare
5 of 15 tasks
danieleades
force-pushed
the
claude/remove-unused-code-lint-b2f0he
branch
from
September 4, 2026 07:30
74a3678 to
4a8ef9c
Compare
danieleades
force-pushed
the
claude/remove-unused-code-lint-b2f0he
branch
2 times, most recently
from
September 20, 2026 15:36
455025c to
a94a7a2
Compare
The proxy, recording and remote code was defined unconditionally while every caller was already behind a `#[cfg(feature = ...)]`, so most of it was dead in all but a handful of feature combinations. Push the gates down to the definitions, and group them so a feature is switched on in as few places as possible: - move the `StaticMockDefinition` YAML representation out of `common::data` into `common::static_mock`, gated once on `record` - split `Recording` and `RecordingRuleBuilder` out of `api::proxy` into `api::record`, so both modules are gated once at their declaration - split `server::state` into `state::proxy` and `state::record`, with the rule and recording maps held in private sub-structs of the state - collect the feature-dependent methods of `MockServer`, `HttpMockServerBuilder` and the request handler into one `impl` block per feature `MockServerAdapter` keeps a `#[cfg]` per method, since adapters are used as trait objects and cannot be split up.
Every feature combination is now free of dead code, so the allowance can go.
danieleades
force-pushed
the
claude/remove-unused-code-lint-b2f0he
branch
from
September 23, 2026 12:11
a94a7a2 to
fc3db69
Compare
Also fixes what master broke without conflicts: gate the cookie readers now that httpmock#297 made cookies optional, drop the KeyValueOperator variants nothing constructs since httpmock#312 made matchers private, and remove a TryInto import the redundant_imports lint from httpmock#316 rejects.
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.
Removes dead_code = "allow" from [lints.rust].
The proxy, recording and remote code was defined unconditionally while every caller was already behind a #[cfg(feature = ...)], so most of it was dead in all but a handful of feature combinations. The fix pushes the gates down to the definitions rather than adding more at the call sites, and groups them so a feature is switched on in as few places as possible