aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references/rename.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-16 16:17:36 +0000
committerGitHub <[email protected]>2021-02-16 16:17:36 +0000
commitf7b7a09f752caba21f2b21ccb8f74421a599d2c6 (patch)
tree7ae74a1d80fa0d17d389e96de978ca63374420bf /crates/ide/src/references/rename.rs
parentcc49502ab47bcd20c90589226282b8f3c3df5190 (diff)
parentf9bb398cc50d2cad543cd5d2d135db5574ba3a6c (diff)
Merge #7696
7696: Fix a few clippy::perf warnings r=kjeremy a=kjeremy Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ide/src/references/rename.rs')
-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()