diff --git a/Cargo.toml b/Cargo.toml index 76339a17c..91df57938 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,6 @@ cast_precision_loss = "warn" cast_sign_loss = "warn" checked_conversions = "warn" doc_markdown = "warn" -from_iter_instead_of_collect = "warn" implicit_saturating_sub = "warn" manual_assert = "warn" map_unwrap_or = "warn" diff --git a/pkcs12/src/safe_bag.rs b/pkcs12/src/safe_bag.rs index eb4ffb61f..212d8ce93 100644 --- a/pkcs12/src/safe_bag.rs +++ b/pkcs12/src/safe_bag.rs @@ -44,10 +44,7 @@ impl<'a> ::der::DecodeValue<'a> for SafeBag { _header: ::der::Header, ) -> ::der::Result { let bag_id = reader.decode()?; - let bag_value = match reader.tlv_bytes() { - Ok(v) => v.to_vec(), - Err(e) => return Err(e), - }; + let bag_value = reader.tlv_bytes()?.to_vec(); let bag_attributes = reader.decode()?; Ok(Self { bag_id, diff --git a/x509-cert/src/ext/pkix/sct.rs b/x509-cert/src/ext/pkix/sct.rs index 236d08e46..c8f6c50f3 100644 --- a/x509-cert/src/ext/pkix/sct.rs +++ b/x509-cert/src/ext/pkix/sct.rs @@ -70,7 +70,7 @@ impl SignedCertificateTimestampList { pub fn parse_timestamps(&self) -> Result, Error> { let (tls_vec, rest) = TlsByteVecU16::tls_deserialize_bytes(self.0.as_bytes())?; if !rest.is_empty() { - return Err(tls_codec::Error::TrailingData)?; + return Err(tls_codec::Error::TrailingData.into()); } let mut bytes = tls_vec.as_slice(); let mut result = Vec::new(); @@ -112,7 +112,7 @@ impl SerializedSct { pub fn parse_timestamp(&self) -> Result { let (sct, rest) = SignedCertificateTimestamp::tls_deserialize_bytes(self.data.as_slice())?; if !rest.is_empty() { - return Err(tls_codec::Error::TrailingData)?; + return Err(tls_codec::Error::TrailingData.into()); } Ok(sct) }