diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-24 21:52:27 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-24 22:04:21 -0800 |
| commit | 18878b155ebf3c70445f2a461582475f5ef72c92 (patch) | |
| tree | 1c969e6b0675b48b99ef79d5b70e7ff269f817a8 /src/libcore | |
| parent | ad04cce61c366968098e2adc8594e21e91c578e0 (diff) | |
| download | rust-18878b155ebf3c70445f2a461582475f5ef72c92.tar.gz rust-18878b155ebf3c70445f2a461582475f5ef72c92.zip | |
std: Require `&mut self` for Iterator::all
Keeps the method consistent with `Iterator::any`. Closes #22617 [breaking-change]
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 48ec1342971..f82538e0b2a 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -637,8 +637,8 @@ pub trait IteratorExt: Iterator + Sized { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - fn all<F>(self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool { - for x in self { if !f(x) { return false; } } + fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool { + for x in self.by_ref() { if !f(x) { return false; } } true } |
