summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Wirzenius <liw@sequoia-pgp.org>2021-09-29 15:05:32 +0300
committerLars Wirzenius <liw@sequoia-pgp.org>2021-09-30 08:31:19 +0300
commit347e9519954b1a7702d7120d6c265ea3d82b64cc (patch)
tree152f5f3d8fa672996ae8c9752edc8ce6ac2c3d48
parent798433cafd6d3b1e4c411f4e022277a6b8450746 (diff)
Annotate functions where clippy::redundant_pattern_matching is OK
See https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
-rw-r--r--ffi/src/error.rs1
-rw-r--r--openpgp-ffi/src/error.rs1
-rw-r--r--openpgp/src/packet/signature/subpacket.rs1
-rw-r--r--openpgp/src/parse/packet_parser_builder.rs1
-rw-r--r--openpgp/src/parse/stream.rs1
-rw-r--r--sq/src/commands/dump.rs1
6 files changed, 6 insertions, 0 deletions
diff --git a/ffi/src/error.rs b/ffi/src/error.rs
index 003477dd..b1c77a1e 100644
--- a/ffi/src/error.rs
+++ b/ffi/src/error.rs
@@ -13,6 +13,7 @@ trait FromSequoiaError<'a> {
}
impl<'a> FromSequoiaError<'a> for Status {
+ #[allow(clippy::redundant_pattern_matching)]
fn from_sequoia_error(e: &'a anyhow::Error) -> Self {
if let Some(e) = e.downcast_ref::<net::Error>() {
return match e {
diff --git a/openpgp-ffi/src/error.rs b/openpgp-ffi/src/error.rs
index 1709e1c9..7dc6d8a4 100644
--- a/openpgp-ffi/src/error.rs
+++ b/openpgp-ffi/src/error.rs
@@ -208,6 +208,7 @@ pub extern "C" fn pgp_status_to_string(status: Status) -> *const c_char {
}
impl<'a> From<&'a anyhow::Error> for Status {
+ #[allow(clippy::redundant_pattern_matching)]
fn from(e: &'a anyhow::Error) -> Self {
if let Some(e) = e.downcast_ref::<openpgp::Error>() {
return match e {
diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs
index 558d3f9c..40e1bb2e 100644
--- a/openpgp/src/packet/signature/subpacket.rs
+++ b/openpgp/src/packet/signature/subpacket.rs
@@ -2141,6 +2141,7 @@ impl SubpacketAreas {
///
/// For subpackets that can safely occur in both subpacket areas,
/// this function prefers instances in the hashed subpacket area.
+ #[allow(clippy::redundant_pattern_matching)]
pub fn subpacket_mut(&mut self, tag: SubpacketTag)
-> Option<&mut Subpacket> {
if let Some(_) = self.hashed_area().subpacket(tag) {
diff --git a/openpgp/src/parse/packet_parser_builder.rs b/openpgp/src/parse/packet_parser_builder.rs
index d94a5d2e..24b9a13b 100644
--- a/openpgp/src/parse/packet_parser_builder.rs
+++ b/openpgp/src/parse/packet_parser_builder.rs
@@ -396,6 +396,7 @@ impl<'a> PacketParserBuilder<'a> {
/// ppr = pp.recurse()?.1;
/// }
/// # Ok(()) }
+ #[allow(clippy::redundant_pattern_matching)]
pub fn build(mut self)
-> Result<PacketParserResult<'a>>
where Self: 'a
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index 141b8f5c..22dbf9a0 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -2265,6 +2265,7 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
}
/// Creates the `Decryptor`, and buffers the data up to `buffer_size`.
+ #[allow(clippy::redundant_pattern_matching)]
fn from_buffered_reader<T>(
policy: &'a dyn Policy,
bio: Box<dyn BufferedReader<Cookie> + 'a>,
diff --git a/sq/src/commands/dump.rs b/sq/src/commands/dump.rs
index c2d0aa03..58401baa 100644
--- a/sq/src/commands/dump.rs
+++ b/sq/src/commands/dump.rs
@@ -52,6 +52,7 @@ impl Convert<chrono::DateTime<chrono::offset::Utc>> for Timestamp {
}
}
+#[allow(clippy::redundant_pattern_matching)]
pub fn dump<W>(input: &mut (dyn io::Read + Sync + Send),
output: &mut dyn io::Write,
mpis: bool, hex: bool, sk: Option<&SessionKey>,