Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove useless mut in set_namespaces #25

Merged
merged 4 commits into from
Jan 8, 2025
Merged

remove useless mut in set_namespaces #25

merged 4 commits into from
Jan 8, 2025

Conversation

oroulet
Copy link
Member

@oroulet oroulet commented Jan 8, 2025

No description provided.

@oroulet
Copy link
Member Author

oroulet commented Jan 8, 2025

@einarmo @svanharmelen do you have any ideas why clippy did not warn about that useless mut?
I wanted to make that method not being mut, was ready to add locks everywhere and then found out it was simply useless...

Copy link
Contributor

@einarmo einarmo left a comment

Choose a reason for hiding this comment

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

Clippy doesn't warn about unused &mut in arguments like this because in addition to having the meaning "mutable access", &mut also means unique access, and sometimes there may be invariants you want to enforce with unique access to a value.

There may be an optional lint for this, but the default clippy lints are supposed to be the ones that are always applicable.

@oroulet oroulet merged commit c5c3618 into master Jan 8, 2025
6 checks passed
@oroulet oroulet deleted the nomut branch January 8, 2025 07:13
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.

2 participants