diff options
| author | bors <bors@rust-lang.org> | 2019-04-06 21:34:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-04-06 21:34:12 +0000 |
| commit | 091380021a8f05bb3b533209e588a9f7c0e9486b (patch) | |
| tree | 9e8cf1fceb25e7ec236ae728b20ead419139a0ad /src/libstd | |
| parent | 8159f389f6cc8ec3e3ea009222d6926da77371ec (diff) | |
| parent | 4601ff017fcccd8eb2874d09b58c86ba675f1188 (diff) | |
| download | rust-091380021a8f05bb3b533209e588a9f7c0e9486b.tar.gz rust-091380021a8f05bb3b533209e588a9f7c0e9486b.zip | |
Auto merge of #59760 - Centril:rollup-4b9x7ue, r=Centril
Rollup of 5 pull requests Successful merges: - #59738 (Move match_path from DefId to lint::LateContext) - #59740 (Use for_each to extend collections) - #59751 (Tiny docs fix) - #59754 (Update books) - #59755 (Update miri) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys_common/wtf8.rs | 4 |
2 files changed, 2 insertions, 6 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())); } } diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs index 7fe1818291e..f17020de44e 100644 --- a/src/libstd/sys_common/wtf8.rs +++ b/src/libstd/sys_common/wtf8.rs @@ -388,9 +388,7 @@ impl Extend<CodePoint> for Wtf8Buf { let (low, _high) = iterator.size_hint(); // Lower bound of one byte per code point (ASCII only) self.bytes.reserve(low); - for code_point in iterator { - self.push(code_point); - } + iterator.for_each(move |code_point| self.push(code_point)); } } |
