mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 15:43:24 +03:00
Add each_parent to WindowsPath
This commit is contained in:
@@ -508,6 +508,14 @@ pub fn get_ctime(&self) -> Option<(i64, int)> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Execute a function on p as well as all of its ancestors
|
||||
pub fn each_parent(&self, f: &fn(&Path)) {
|
||||
if !self.components.is_empty() {
|
||||
f(self);
|
||||
self.pop().each_parent(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToStr for PosixPath {
|
||||
|
||||
Reference in New Issue
Block a user