Skip to content

style: remove unneeded 'mut' - #211

Merged
FalkWoldmann merged 4 commits into
httpmock:masterfrom
danieleades:unneeded_mut
Jan 21, 2026
Merged

FalkWoldmann merged 4 commits into
httpmock:masterfrom
danieleades:unneeded_mut

Conversation

@danieleades

Copy link
Copy Markdown
Contributor

remove unneeded 'mut' annotations.

addresses 162 compiler warnings (see #209)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mut from read-only MutexGuard variables in state management
  • Removed mut from builder pattern methods that take ownership of self
  • Removed mut from 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.

Comment thread src/server/handler.rs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@FalkWoldmann

Copy link
Copy Markdown
Member

Thanks!

@FalkWoldmann
FalkWoldmann merged commit 1434198 into httpmock:master Jan 21, 2026
@danieleades
danieleades deleted the unneeded_mut branch January 21, 2026 17:46
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.

3 participants