mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Replace if let Some(_) = foo
with if foo.is_some()
This commit is contained in:
parent
eff195852d
commit
f29796da61
6 changed files with 7 additions and 7 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue