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 /tool | |
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 'tool')
-rw-r--r-- | tool/src/commands/decrypt.rs | 2 | ||||
-rw-r--r-- | tool/src/commands/mod.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index 2ab0f32c..325a657d 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -130,7 +130,7 @@ impl<'a> VerificationHelper for Helper<'a> { fn get_public_keys(&mut self, ids: &[openpgp::KeyHandle]) -> Result<Vec<Cert>> { self.vhelper.get_public_keys(ids) } - fn check(&mut self, structure: &MessageStructure) -> Result<()> { + fn check(&mut self, structure: MessageStructure) -> Result<()> { self.vhelper.check(structure) } } diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs index 12ca6c6a..25b94198 100644 --- a/tool/src/commands/mod.rs +++ b/tool/src/commands/mod.rs @@ -356,7 +356,7 @@ impl<'a> VerificationHelper for VHelper<'a> { Ok(certs) } - fn check(&mut self, structure: &MessageStructure) -> Result<()> { + fn check(&mut self, structure: MessageStructure) -> Result<()> { for layer in structure.iter() { match layer { MessageLayer::Compression { algo } => |