aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2021-02-16 15:55:34 +0000
committerkjeremy <[email protected]>2021-02-16 15:55:34 +0000
commitf9bb398cc50d2cad543cd5d2d135db5574ba3a6c (patch)
tree7ae74a1d80fa0d17d389e96de978ca63374420bf /crates/ide/src/references
parentcc49502ab47bcd20c90589226282b8f3c3df5190 (diff)
Fix a few clippy::perf warnings
Diffstat (limited to 'crates/ide/src/references')
-rw-r--r--crates/ide/src/references/rename.rs6
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()