summaryrefslogtreecommitdiffstats
path: root/openpgp/src/message
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-11-22 18:59:48 +0100
committerNora Widdecke <nora@sequoia-pgp.org>2021-11-29 11:53:55 +0100
commit192460a201a631a03e8e5a00469343fbe73fb437 (patch)
tree309950ae109511a5e62391e8b3cf3591f79d6f39 /openpgp/src/message
parentb2ffb4401fad2f5c51f35d56a4408c23c10a3450 (diff)
Prefer vec! macro.
- The vec![] macro is more performant and often easier to read than multiple push calls. - Allow push to a Vec straight after creation in tests. Performance is not that great of an issue in tests, and the fix would impact legibility. - Found by clippy::vec_init_then_push.
Diffstat (limited to 'openpgp/src/message')
-rw-r--r--openpgp/src/message/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs
index 662e4e02..0967607e 100644
--- a/openpgp/src/message/mod.rs
+++ b/openpgp/src/message/mod.rs
@@ -799,6 +799,7 @@ mod tests {
assert!(message.is_ok(), "{:?}", message);
}
+ #[allow(clippy::vec_init_then_push)]
#[test]
fn compressed_part() {
let mut lit = Literal::new(Text);
@@ -861,6 +862,7 @@ mod tests {
assert!(message.is_ok(), "{:?}", message);
}
+ #[allow(clippy::vec_init_then_push)]
#[test]
fn one_pass_sig_part() {
let mut lit = Literal::new(Text);
@@ -973,6 +975,7 @@ mod tests {
assert!(message.is_ok(), "{:?}", message);
}
+ #[allow(clippy::vec_init_then_push)]
#[test]
fn signature_part() {
let mut lit = Literal::new(Text);