From bafe9a0f61f7edb56ff3bd2c14cb52d938de2960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Sat, 2 Jan 2021 13:47:53 +0100 Subject: [PATCH] crypto: Fix a couple of clippy warnings. --- matrix_sdk_crypto/src/verification/sas/helpers.rs | 6 +++--- matrix_sdk_crypto/src/verification/sas/inner_sas.rs | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/matrix_sdk_crypto/src/verification/sas/helpers.rs b/matrix_sdk_crypto/src/verification/sas/helpers.rs index 76d29729..248c3a28 100644 --- a/matrix_sdk_crypto/src/verification/sas/helpers.rs +++ b/matrix_sdk_crypto/src/verification/sas/helpers.rs @@ -621,9 +621,9 @@ mod test { fn proptest_decimals(bytes in prop::array::uniform5(0u8..)) { let (first, second, third) = bytes_to_decimal(bytes.to_vec()); - prop_assert!(first <= 9191 && first >= 1000); - prop_assert!(second <= 9191 && second >= 1000); - prop_assert!(third <= 9191 && third >= 1000); + prop_assert!((1000..=9191).contains(&first)); + prop_assert!((1000..=9191).contains(&second)); + prop_assert!((1000..=9191).contains(&third)); } } } diff --git a/matrix_sdk_crypto/src/verification/sas/inner_sas.rs b/matrix_sdk_crypto/src/verification/sas/inner_sas.rs index 3f8e08ad..49eeb5a5 100644 --- a/matrix_sdk_crypto/src/verification/sas/inner_sas.rs +++ b/matrix_sdk_crypto/src/verification/sas/inner_sas.rs @@ -302,11 +302,7 @@ impl InnerSas { } pub fn can_be_presented(&self) -> bool { - match self { - InnerSas::KeyRecieved(_) => true, - InnerSas::MacReceived(_) => true, - _ => false, - } + matches!(self, InnerSas::KeyRecieved(_) | InnerSas::MacReceived(_)) } pub fn is_done(&self) -> bool {