diff options
author | kjeremy <[email protected]> | 2021-02-16 15:55:34 +0000 |
---|---|---|
committer | kjeremy <[email protected]> | 2021-02-16 15:55:34 +0000 |
commit | f9bb398cc50d2cad543cd5d2d135db5574ba3a6c (patch) | |
tree | 7ae74a1d80fa0d17d389e96de978ca63374420bf /crates/ide/src/references | |
parent | cc49502ab47bcd20c90589226282b8f3c3df5190 (diff) |
Fix a few clippy::perf warnings
Diffstat (limited to 'crates/ide/src/references')
-rw-r--r-- | crates/ide/src/references/rename.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index 08f16b54d..a4b320227 100644 --- a/crates/ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs | |||
@@ -342,8 +342,10 @@ fn rename_to_self(sema: &Semantics<RootDatabase>, local: hir::Local) -> RenameRe | |||
342 | 342 | ||
343 | // FIXME: reimplement this on the hir instead | 343 | // FIXME: reimplement this on the hir instead |
344 | // as of the time of this writing params in hir don't keep their names | 344 | // as of the time of this writing params in hir don't keep their names |
345 | let fn_ast = | 345 | let fn_ast = fn_def |
346 | fn_def.source(sema.db).ok_or(format_err!("Cannot rename non-param local to self"))?.value; | 346 | .source(sema.db) |
347 | .ok_or_else(|| format_err!("Cannot rename non-param local to self"))? | ||
348 | .value; | ||
347 | 349 | ||
348 | let first_param_range = fn_ast | 350 | let first_param_range = fn_ast |
349 | .param_list() | 351 | .param_list() |