diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-21 18:41:02 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:05 +0300 |
commit | 7dea96c33715e762dec084fd30ddd5615133e746 (patch) | |
tree | de44bf76664e4a605c723542c9627d782655da93 | |
parent | 9f789effd3a415e61dfdeae58cf690a2cb7f053a (diff) |
Drop unnecessary mut when passing a reference to a function
Reduce this:
foo(&mut bar):
into
foo(&bar);
when the function does not expect a mutable reference, just a
read-only reference. The extra mut serves no function, but can confuse
the reader.
Found by clippy lint unnecessary_mut_passed:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
-rw-r--r-- | openpgp/src/parse.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/parse.rs b/openpgp/src/parse.rs index eacded35..068bdd6b 100644 --- a/openpgp/src/parse.rs +++ b/openpgp/src/parse.rs @@ -4807,7 +4807,7 @@ impl <'a> PacketParser<'a> { tracer!(TRACE, "PacketParser::finish", indent); if self.finished { - return Ok(&mut self.packet); + return Ok(&self.packet); } let recursion_depth = self.recursion_depth(); @@ -4848,7 +4848,7 @@ impl <'a> PacketParser<'a> { self.finished = true; - Ok(&mut self.packet) + Ok(&self.packet) } /// Hashes content that has been streamed. |