We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Paths::path_response
I think that you can restructure this little piece of code to avoid the extra break.
let Some(primary) = self.migration_target.as_mut() else { break; } if Rc::ptr_eq(target, primary) { let p = primary.take(); mem::drop(self.select_primary(&p, now)); return true; } break;
Once we're on 1.80 MSRV, we can use Option::take_if and simplify further.
Option::take_if
if let Some(primary) = self.migration_target.take_if(|p| Rc::ptr_eq(target, p)) mem::drop(self.select_primary(&primary, now)); return true; } break;
Originally posted by @martinthomson in #2294 (comment)
The text was updated successfully, but these errors were encountered:
unwrap
expect
No branches or pull requests
I think that you can restructure this little piece of code to avoid the extra break.
Once we're on 1.80 MSRV, we can use
Option::take_if
and simplify further.Originally posted by @martinthomson in #2294 (comment)
The text was updated successfully, but these errors were encountered: