mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
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.
This commit is contained in:
parent
4cfc767d7f
commit
c2015e7d18
5 changed files with 12 additions and 12 deletions
|
@ -127,7 +127,7 @@ impl HasSource for Impl {
|
|||
}
|
||||
|
||||
impl HasSource for TypeParam {
|
||||
type Ast = Either<ast::Trait, ast::TypeParam>;
|
||||
type Ast = Either<ast::TypeParam, ast::Trait>;
|
||||
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>> {
|
||||
let child_source = self.id.parent.child_source(db.upcast());
|
||||
Some(child_source.map(|it| it[self.id.local_id].clone()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue