We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b7fbfb6 + 6ad6cc3 commit 3330f54Copy full SHA for 3330f54
src/libstd/path.rs
@@ -1879,6 +1879,20 @@ impl AsRef<Path> for PathBuf {
1879
fn as_ref(&self) -> &Path { self }
1880
}
1881
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
1890
+impl<'a> IntoIterator for &'a Path {
1891
1892
1893
1894
1895
1896
#[cfg(test)]
1897
mod tests {
1898
use super::*;
0 commit comments