mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
Add each_parent to WindowsPath
This commit is contained in:
parent
8f5cb92f89
commit
d600601162
@ -508,6 +508,14 @@ impl WindowsPath {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user