mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Avoid using ModPath's fields directly
This commit is contained in:
parent
de046bf457
commit
474df093a9
3 changed files with 9 additions and 8 deletions
|
@ -201,10 +201,10 @@ impl Path {
|
|||
}
|
||||
let res = Path {
|
||||
type_anchor: self.type_anchor.clone(),
|
||||
mod_path: ModPath {
|
||||
kind: self.mod_path.kind.clone(),
|
||||
segments: self.mod_path.segments[..self.mod_path.segments.len() - 1].to_vec(),
|
||||
},
|
||||
mod_path: ModPath::from_segments(
|
||||
self.mod_path.kind.clone(),
|
||||
self.mod_path.segments[..self.mod_path.segments.len() - 1].iter().cloned(),
|
||||
),
|
||||
generic_args: self.generic_args[..self.generic_args.len() - 1].to_vec(),
|
||||
};
|
||||
Some(res)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue