about summary refs log tree commit diff
path: root/src/libstd/iterator.rs
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2013-06-21 20:08:35 -0400
committerBen Blum <bblum@andrew.cmu.edu>2013-06-29 04:39:34 -0400
commitff4ab9e147b0be4126b8b70ca6ab27173a46077a (patch)
treef028c640cd8a3efd7f8ec5661ba255d269250dbe /src/libstd/iterator.rs
parent89110fdf55c000096fc24a78d35256544c7b523f (diff)
downloadrust-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.rs2
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,
             }