diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2013-06-21 20:08:35 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2013-06-29 04:39:34 -0400 |
| commit | ff4ab9e147b0be4126b8b70ca6ab27173a46077a (patch) | |
| tree | f028c640cd8a3efd7f8ec5661ba255d269250dbe /src/libstd/iterator.rs | |
| parent | 89110fdf55c000096fc24a78d35256544c7b523f (diff) | |
| download | rust-ff4ab9e147b0be4126b8b70ca6ab27173a46077a.tar.gz rust-ff4ab9e147b0be4126b8b70ca6ab27173a46077a.zip | |
'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep for making them noncopyable.
Diffstat (limited to 'src/libstd/iterator.rs')
| -rw-r--r-- | src/libstd/iterator.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index 765bf3b36f2..976ca8bae7a 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -964,7 +964,7 @@ impl<'self, A, T: Iterator<A>, B, U: Iterator<B>> Iterator<B> for return Some(x) } } - match self.iter.next().map_consume(self.f) { + match self.iter.next().map_consume(|x| (self.f)(x)) { None => return None, next => self.subiter = next, } |
