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

@ -156,7 +156,7 @@ fn rename_to_self(sema: &Semantics<RootDatabase>, local: hir::Local) -> RenameRe
_ => bail!("Cannot rename local to self outside of function"),
};
if let Some(_) = fn_def.self_param(sema.db) {
if fn_def.self_param(sema.db).is_some() {
bail!("Method already has a self parameter");
}

View file

@ -330,7 +330,7 @@ fn traverse(
}
}
if let Some(_) = macro_highlighter.highlight(element_to_highlight.clone()) {
if macro_highlighter.highlight(element_to_highlight.clone()).is_some() {
continue;
}