summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-01-10 13:11:45 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-01-10 13:56:11 +0100
commit71fc2c6afbcbf4cc4e060dd59300e8065e699323 (patch)
treec1b4ae762fcea2a137bb8c585d9e47bc86402357 /tool
parentb64d45cf84cb7baee3a88a12f1cbf52ad3fb74d3 (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.rs2
-rw-r--r--tool/src/commands/mod.rs2
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 } =>