diff options
Diffstat (limited to 'src/libstd/path.rs')
| -rw-r--r-- | src/libstd/path.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 71e82f0a9b0..1bbda9b5bcb 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1551,9 +1551,7 @@ impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf { #[stable(feature = "rust1", since = "1.0.0")] impl<P: AsRef<Path>> iter::Extend<P> for PathBuf { fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I) { - for p in iter { - self.push(p.as_ref()) - } + iter.into_iter().for_each(move |p| self.push(p.as_ref())); } } |
