Simplify
This commit is contained in:
parent
b454f11f38
commit
0bb631bf71
2 changed files with 6 additions and 9 deletions
|
@ -3,7 +3,7 @@
|
|||
use crate::intern::Interned;
|
||||
|
||||
use either::Either;
|
||||
use hir_expand::name::{known, name, AsName};
|
||||
use hir_expand::name::{name, AsName};
|
||||
use syntax::ast::{self, AstNode, HasTypeBounds};
|
||||
|
||||
use super::AssociatedTypeBinding;
|
||||
|
@ -54,7 +54,7 @@ pub(super) fn lower_path(mut path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
|
|||
}
|
||||
}
|
||||
ast::PathSegmentKind::SelfTypeKw => {
|
||||
segments.push(known::SELF_TYPE);
|
||||
segments.push(name![Self]);
|
||||
generic_args.push(None)
|
||||
}
|
||||
ast::PathSegmentKind::Type { type_ref, trait_ref } => {
|
||||
|
|
|
@ -167,13 +167,10 @@ fn convert_path(
|
|||
}
|
||||
}
|
||||
ast::PathSegmentKind::SelfTypeKw => {
|
||||
let mut res = prefix.unwrap_or_else(|| {
|
||||
ModPath::from_kind(
|
||||
segment.coloncolon_token().map_or(PathKind::Plain, |_| PathKind::Abs),
|
||||
)
|
||||
});
|
||||
res.segments.push(known::SELF_TYPE);
|
||||
res
|
||||
if prefix.is_some() {
|
||||
return None;
|
||||
}
|
||||
ModPath::from_segments(PathKind::Plain, Some(known::SELF_TYPE))
|
||||
}
|
||||
ast::PathSegmentKind::CrateKw => {
|
||||
if prefix.is_some() {
|
||||
|
|
Loading…
Add table
Reference in a new issue