We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
IntoIterator
&{Path, PathBuf}
1 parent af6e413 commit 6ad6cc3Copy full SHA for 6ad6cc3
src/libstd/path.rs
@@ -1856,6 +1856,20 @@ impl AsRef<Path> for PathBuf {
1856
fn as_ref(&self) -> &Path { self }
1857
}
1858
1859
+#[stable(feature = "path_into_iter", since = "1.6.0")]
1860
+impl<'a> IntoIterator for &'a PathBuf {
1861
+ type Item = &'a OsStr;
1862
+ type IntoIter = Iter<'a>;
1863
+ fn into_iter(self) -> Iter<'a> { self.iter() }
1864
+}
1865
+
1866
1867
+impl<'a> IntoIterator for &'a Path {
1868
1869
1870
1871
1872
1873
#[cfg(test)]
1874
mod tests {
1875
use super::*;
0 commit comments