mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
accepting review suggestions
This commit is contained in:
parent
c372fb3495
commit
66fe84d936
13 changed files with 67 additions and 97 deletions
|
@ -184,6 +184,13 @@ impl AbsPath {
|
|||
self.0.ends_with(&suffix.0)
|
||||
}
|
||||
|
||||
pub fn name_and_extension(&self) -> Option<(&str, Option<&str>)> {
|
||||
Some((
|
||||
self.file_stem()?.to_str()?,
|
||||
self.extension().and_then(|extension| extension.to_str()),
|
||||
))
|
||||
}
|
||||
|
||||
// region:delegate-methods
|
||||
|
||||
// Note that we deliberately don't implement `Deref<Target = Path>` here.
|
||||
|
@ -213,13 +220,6 @@ impl AbsPath {
|
|||
pub fn exists(&self) -> bool {
|
||||
self.0.exists()
|
||||
}
|
||||
|
||||
pub fn name_and_extension(&self) -> Option<(&str, Option<&str>)> {
|
||||
Some((
|
||||
self.file_stem()?.to_str()?,
|
||||
self.extension().and_then(|extension| extension.to_str()),
|
||||
))
|
||||
}
|
||||
// endregion:delegate-methods
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue