diff options
| author | Josh Stone <jistone@redhat.com> | 2020-04-07 16:58:52 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2020-04-07 16:58:52 -0700 |
| commit | ce8abc63a7e1fcac4b69574e00a70352e583cec8 (patch) | |
| tree | 140c01566c45282b0a019d5df75c7e90dd3595a3 /src/libcore | |
| parent | 2c4cffde3bdc36d9634ebf24e512f19aa6fe1ccb (diff) | |
| download | rust-ce8abc63a7e1fcac4b69574e00a70352e583cec8.tar.gz rust-ce8abc63a7e1fcac4b69574e00a70352e583cec8.zip | |
Avoid extra &mut in Chain::fold and try_fold
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter/adapters/chain.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/iter/adapters/chain.rs b/src/libcore/iter/adapters/chain.rs index aadecdfbb65..2dd405ced20 100644 --- a/src/libcore/iter/adapters/chain.rs +++ b/src/libcore/iter/adapters/chain.rs @@ -84,7 +84,7 @@ where self.a = None; } if let Some(ref mut b) = self.b { - acc = b.try_fold(acc, &mut f)?; + acc = b.try_fold(acc, f)?; self.b = None; } Try::from_ok(acc) @@ -98,7 +98,7 @@ where acc = a.fold(acc, &mut f); } if let Some(b) = self.b { - acc = b.fold(acc, &mut f); + acc = b.fold(acc, f); } acc } |
