Repository navigation
style: remove unneeded 'mut' - #211
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes unnecessary mut keywords from variable declarations throughout the codebase to address 162 compiler warnings about unused mutability. The changes span multiple modules including server state management, request handlers, API builders, and utility functions.
Changes:
- Removed
mutfrom read-only MutexGuard variables in state management - Removed
mutfrom builder pattern methods that take ownership ofself - Removed
mutfrom variables that are never reassigned
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/server/state.rs | Removed mut from read-only lock guards in read_mock, verify, find_forward_rule, and find_proxy_rule methods |
| src/server/handler.rs | Attempted to remove mut from is_proxied variable (contains bug) |
| src/server/builder.rs | Removed mut from build_with_state method's self parameter |
| src/common/util.rs | Removed mut from opened_file variable in match expression |
| src/api/spec.rs | Removed mut from 60+ builder methods' self parameters in the fluent API |
| src/api/server.rs | Removed mut from req and res variables in mock_async method |
| src/api/proxy.rs | Removed mut from self parameters in builder methods and request_requirements local variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
danieleades
force-pushed
the
unneeded_mut
branch
from
January 19, 2026 08:16
dc1eae0 to
2a8e214
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Thanks! |
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.
remove unneeded 'mut' annotations.
addresses 162 compiler warnings (see #209)