mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Simplify
This commit is contained in:
parent
89218cf29c
commit
60fa981df1
11 changed files with 113 additions and 149 deletions
|
@ -41,7 +41,7 @@ pub fn mod_path_to_ast(path: &hir::ModPath) -> ast::Path {
|
|||
let mut is_abs = false;
|
||||
match path.kind {
|
||||
hir::PathKind::Plain => {}
|
||||
hir::PathKind::Super(0) => segments.push(make::path_segment_self()),
|
||||
hir::PathKind::SELF => segments.push(make::path_segment_self()),
|
||||
hir::PathKind::Super(n) => segments.extend((0..n).map(|_| make::path_segment_super())),
|
||||
hir::PathKind::DollarCrate(_) | hir::PathKind::Crate => {
|
||||
segments.push(make::path_segment_crate())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue