Skip to content

Commit 3330f54

Browse files
committed
Auto merge of #29514 - apasel422:issue-26220, r=alexcrichton
Closes #26220. r? @alexcrichton
2 parents b7fbfb6 + 6ad6cc3 commit 3330f54

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/libstd/path.rs

+14
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,20 @@ impl AsRef<Path> for PathBuf {
18791879
fn as_ref(&self) -> &Path { self }
18801880
}
18811881

1882+
#[stable(feature = "path_into_iter", since = "1.6.0")]
1883+
impl<'a> IntoIterator for &'a PathBuf {
1884+
type Item = &'a OsStr;
1885+
type IntoIter = Iter<'a>;
1886+
fn into_iter(self) -> Iter<'a> { self.iter() }
1887+
}
1888+
1889+
#[stable(feature = "path_into_iter", since = "1.6.0")]
1890+
impl<'a> IntoIterator for &'a Path {
1891+
type Item = &'a OsStr;
1892+
type IntoIter = Iter<'a>;
1893+
fn into_iter(self) -> Iter<'a> { self.iter() }
1894+
}
1895+
18821896
#[cfg(test)]
18831897
mod tests {
18841898
use super::*;

0 commit comments

Comments
 (0)