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

Refac unnecessary ref mut pattern matching #943

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcospb19
Copy link
Contributor

As an attempt to make the code more idiomatic.

@marcospb19
Copy link
Contributor Author

marcospb19 commented Nov 19, 2023

Knowing "idiomatic Rust" is a subjective concept, feel free to close this if you don't see benefit in it.

I believe it is important to have the examples without it because I see ref mut as an anti-pattern when it is not necessary anymore.

@marcospb19
Copy link
Contributor Author

I didn't include changes like this:

// From
if let Some(ref mut dac) = maybe_dac {
// To
if let Some(dac) = &mut maybe_dac {

That replace ref mut by &mut, I prefer the latter, but I guess in that case it doesn't matter A or B.

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.

1 participant