Skip to content

Commit bf074b3

Browse files
committed
---
yaml --- r: 66412 b: refs/heads/master c: d600601 h: refs/heads/master v: v3
1 parent 67e4c9d commit bf074b3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8f5cb92f89a48fd47b0eff6fa72aa2f0b18188b3
2+
refs/heads/master: d600601162d8a28b0a7e4eeaba81d0c2cee2e226
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/path.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,14 @@ impl WindowsPath {
508508
}
509509
}
510510
}
511+
512+
/// Execute a function on p as well as all of its ancestors
513+
pub fn each_parent(&self, f: &fn(&Path)) {
514+
if !self.components.is_empty() {
515+
f(self);
516+
self.pop().each_parent(f);
517+
}
518+
}
511519
}
512520

513521
impl ToStr for PosixPath {

0 commit comments

Comments
 (0)