From c2015e7d182f3cb2cebe686127dd6a3e683df9e6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jun 2021 22:42:43 +0300 Subject: 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. --- crates/ide_db/src/rename.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_db') 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 { hir::GenericParam::TypeParam(type_param) => { let src = type_param.source(sema.db)?; let name = match &src.value { - Either::Left(_) => return None, - Either::Right(type_param) => type_param.name()?, + Either::Left(type_param) => type_param.name()?, + Either::Right(_trait) => return None, }; src.with_value(name.syntax()).original_file_range(sema.db) } -- cgit v1.2.3