diff options
| author | bors <bors@rust-lang.org> | 2015-11-03 04:52:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-03 04:52:12 +0000 |
| commit | 3330f5419880d34cf8bf9c1f286d569a304b6279 (patch) | |
| tree | fb2e7d5c510f1366a7225aafd69fee1bab524c94 | |
| parent | b7fbfb658e0e3e3be37c5b6704fd6b4d5991ae8c (diff) | |
| parent | 6ad6cc30ef70bbb1f771a551183d317170ddfd7b (diff) | |
| download | rust-3330f5419880d34cf8bf9c1f286d569a304b6279.tar.gz rust-3330f5419880d34cf8bf9c1f286d569a304b6279.zip | |
Auto merge of #29514 - apasel422:issue-26220, r=alexcrichton
Closes #26220. r? @alexcrichton
| -rw-r--r-- | src/libstd/path.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index f1422bb501a..0559849f6a6 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1879,6 +1879,20 @@ impl AsRef<Path> for PathBuf { fn as_ref(&self) -> &Path { self } } +#[stable(feature = "path_into_iter", since = "1.6.0")] +impl<'a> IntoIterator for &'a PathBuf { + type Item = &'a OsStr; + type IntoIter = Iter<'a>; + fn into_iter(self) -> Iter<'a> { self.iter() } +} + +#[stable(feature = "path_into_iter", since = "1.6.0")] +impl<'a> IntoIterator for &'a Path { + type Item = &'a OsStr; + type IntoIter = Iter<'a>; + fn into_iter(self) -> Iter<'a> { self.iter() } +} + #[cfg(test)] mod tests { use super::*; |
