diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-01-10 13:11:45 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-01-10 13:56:11 +0100 |
commit | 71fc2c6afbcbf4cc4e060dd59300e8065e699323 (patch) | |
tree | c1b4ae762fcea2a137bb8c585d9e47bc86402357 /openpgp/src/serialize/stream.rs | |
parent | b64d45cf84cb7baee3a88a12f1cbf52ad3fb74d3 (diff) |
openpgp: Pass MessageStructure by value, not reference.
- Instead of passing MessageStructure to VerificationHelper::check
by reference, pass it by value.
- After calling VerificationHelper::check, it is dropped. Passing
it by value allows the caller to avoid some cloning.
Diffstat (limited to 'openpgp/src/serialize/stream.rs')
-rw-r--r-- | openpgp/src/serialize/stream.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index cabe130b..9c5977c9 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -252,7 +252,7 @@ impl<'a> Signer<'a> { /// Ok(vec![self.0.clone()]) /// } /// - /// fn check(&mut self, structure: &MessageStructure) + /// fn check(&mut self, structure: MessageStructure) /// -> openpgp::Result<()> { /// if let MessageLayer::SignatureGroup { ref results } = /// structure.iter().nth(0).unwrap() @@ -359,7 +359,7 @@ impl<'a> Signer<'a> { /// Ok(vec![self.0.clone()]) /// } /// - /// fn check(&mut self, structure: &MessageStructure) + /// fn check(&mut self, structure: MessageStructure) /// -> openpgp::Result<()> { /// if let MessageLayer::SignatureGroup { ref results } = /// structure.iter().nth(0).unwrap() @@ -1665,7 +1665,7 @@ mod test { -> Result<Vec<Cert>> { Ok(Vec::new()) } - fn check(&mut self, _structure: &MessageStructure) -> Result<()> { + fn check(&mut self, _structure: MessageStructure) -> Result<()> { Ok(()) } } |