mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Adding crate_root_path to crate_graph
This commit is contained in:
parent
8e687f7afb
commit
a3081a6774
10 changed files with 74 additions and 37 deletions
|
@ -107,10 +107,7 @@ impl VfsPath {
|
|||
/// Returns `self`'s base name and file extension.
|
||||
pub fn name_and_extension(&self) -> Option<(&str, Option<&str>)> {
|
||||
match &self.0 {
|
||||
VfsPathRepr::PathBuf(p) => Some((
|
||||
p.file_stem()?.to_str()?,
|
||||
p.extension().and_then(|extension| extension.to_str()),
|
||||
)),
|
||||
VfsPathRepr::PathBuf(p) => p.name_and_extension(),
|
||||
VfsPathRepr::VirtualPath(p) => p.name_and_extension(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue