Skip to content

Commit 575ebbc

Browse files
committed
Add ancestors method to AbsPath
1 parent f1cff1e commit 575ebbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/paths/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ impl AbsPath {
194194
self.0.ends_with(&suffix.0)
195195
}
196196

197+
pub fn ancestors(&self) -> impl Iterator<Item = &AbsPath> {
198+
self.0.ancestors().map(AbsPath::assert)
199+
}
200+
197201
pub fn name_and_extension(&self) -> Option<(&str, Option<&str>)> {
198202
Some((
199203
self.file_stem()?.to_str()?,

0 commit comments

Comments
 (0)