Replace if let Some(_) = foo with if foo.is_some()

This commit is contained in:
Aramis Razzaghipour 2021-10-03 23:51:30 +11:00
parent eff195852d
commit f29796da61
No known key found for this signature in database
GPG key ID: F788F7E990136003
6 changed files with 7 additions and 7 deletions

View file

@ -318,7 +318,7 @@ pub fn source_edit_from_references(
}
fn source_edit_from_name(edit: &mut TextEditBuilder, name: &ast::Name, new_name: &str) -> bool {
if let Some(_) = ast::RecordPatField::for_field_name(name) {
if ast::RecordPatField::for_field_name(name).is_some() {
if let Some(ident_pat) = name.syntax().parent().and_then(ast::IdentPat::cast) {
cov_mark::hit!(rename_record_pat_field_name_split);
// Foo { ref mut field } -> Foo { new_name: ref mut field }