Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/paths/src/lib.rs')
-rw-r--r--crates/paths/src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/paths/src/lib.rs b/crates/paths/src/lib.rs
index 6a3c685016..083dfcf43d 100644
--- a/crates/paths/src/lib.rs
+++ b/crates/paths/src/lib.rs
@@ -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
}