aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-14 20:42:43 +0100
committerAleksey Kladov <[email protected]>2021-06-14 20:42:43 +0100
commitc2015e7d182f3cb2cebe686127dd6a3e683df9e6 (patch)
treeeb46a7d8ad5f0549fd79a51268d79859a1cb6c2d /crates/ide_db
parent4cfc767d7fadeab025227d67f104065c9e8a55d3 (diff)
internal: more natural order of sources for TypeParam
We usually use first (left) variant of `Either` for "usual" case, and use right for odd things. For example, pat source is Pat | SelfParam.
Diffstat (limited to 'crates/ide_db')
-rw-r--r--crates/ide_db/src/rename.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ide_db/src/rename.rs b/crates/ide_db/src/rename.rs
index 82855725f..643e67781 100644
--- a/crates/ide_db/src/rename.rs
+++ b/crates/ide_db/src/rename.rs
@@ -143,8 +143,8 @@ impl Definition {
143 hir::GenericParam::TypeParam(type_param) => { 143 hir::GenericParam::TypeParam(type_param) => {
144 let src = type_param.source(sema.db)?; 144 let src = type_param.source(sema.db)?;
145 let name = match &src.value { 145 let name = match &src.value {
146 Either::Left(_) => return None, 146 Either::Left(type_param) => type_param.name()?,
147 Either::Right(type_param) => type_param.name()?, 147 Either::Right(_trait) => return None,
148 }; 148 };
149 src.with_value(name.syntax()).original_file_range(sema.db) 149 src.with_value(name.syntax()).original_file_range(sema.db)
150 } 150 }