From 6f4bfdef6fb03554b85cc398e0569726d7cb16a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 12 Feb 2023 12:45:05 +0100 Subject: [PATCH 1/2] fix(indexeddb): Fix implementation of SafeEncode for tuple of 5 elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression introduced by merging commit 9707d73 after efdeba7 Signed-off-by: Kévin Commaille --- .../matrix-sdk-indexeddb/src/safe_encode.rs | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/crates/matrix-sdk-indexeddb/src/safe_encode.rs b/crates/matrix-sdk-indexeddb/src/safe_encode.rs index 6ad1c60e440..d3dbbbc4cb6 100644 --- a/crates/matrix-sdk-indexeddb/src/safe_encode.rs +++ b/crates/matrix-sdk-indexeddb/src/safe_encode.rs @@ -230,30 +230,20 @@ where fn as_secure_string(&self, table_name: &str, store_cipher: &StoreCipher) -> String { [ - &base64_encode( - store_cipher.hash_key(table_name, self.0.as_encoded_string().as_bytes()), - &STANDARD_NO_PAD, - ), + &STANDARD_NO_PAD + .encode(store_cipher.hash_key(table_name, self.0.as_encoded_string().as_bytes())), KEY_SEPARATOR, - &base64_encode( - store_cipher.hash_key(table_name, self.1.as_encoded_string().as_bytes()), - &STANDARD_NO_PAD, - ), + &STANDARD_NO_PAD + .encode(store_cipher.hash_key(table_name, self.1.as_encoded_string().as_bytes())), KEY_SEPARATOR, - &base64_encode( - store_cipher.hash_key(table_name, self.2.as_encoded_string().as_bytes()), - &STANDARD_NO_PAD, - ), + &STANDARD_NO_PAD + .encode(store_cipher.hash_key(table_name, self.2.as_encoded_string().as_bytes())), KEY_SEPARATOR, - &base64_encode( - store_cipher.hash_key(table_name, self.3.as_encoded_string().as_bytes()), - &STANDARD_NO_PAD, - ), + &STANDARD_NO_PAD + .encode(store_cipher.hash_key(table_name, self.3.as_encoded_string().as_bytes())), KEY_SEPARATOR, - &base64_encode( - store_cipher.hash_key(table_name, self.4.as_encoded_string().as_bytes()), - &STANDARD_NO_PAD, - ), + &STANDARD_NO_PAD + .encode(store_cipher.hash_key(table_name, self.4.as_encoded_string().as_bytes())), ] .concat() } From 304b17aa8e9c0b671f90b676490aea44f6bf07dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 13 Feb 2023 11:11:05 +0100 Subject: [PATCH 2/2] ci: Silence clippy::extra_unused_type_parameters in affected crates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Triggers false positives. See discussion in https://github.com/rust-lang/rust-clippy/issues/10319. Possibly fixed in https://github.com/rust-lang/rust-clippy/pull/10321. Signed-off-by: Kévin Commaille --- bindings/matrix-sdk-crypto-ffi/src/lib.rs | 3 +++ bindings/matrix-sdk-crypto-js/src/lib.rs | 6 +++++- bindings/matrix-sdk-ffi/src/lib.rs | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bindings/matrix-sdk-crypto-ffi/src/lib.rs b/bindings/matrix-sdk-crypto-ffi/src/lib.rs index 4527025f3b2..d15fd04be2c 100644 --- a/bindings/matrix-sdk-crypto-ffi/src/lib.rs +++ b/bindings/matrix-sdk-crypto-ffi/src/lib.rs @@ -5,6 +5,9 @@ #![warn(missing_docs)] #![allow(unused_qualifications)] +// Triggers false positives. +// See . +#![allow(clippy::extra_unused_type_parameters)] mod backup_recovery_key; mod device; diff --git a/bindings/matrix-sdk-crypto-js/src/lib.rs b/bindings/matrix-sdk-crypto-js/src/lib.rs index 65a70998ae4..31ae7894dce 100644 --- a/bindings/matrix-sdk-crypto-js/src/lib.rs +++ b/bindings/matrix-sdk-crypto-js/src/lib.rs @@ -15,7 +15,11 @@ #![doc = include_str!("../README.md")] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn(missing_docs, missing_debug_implementations)] -#![allow(clippy::drop_non_drop)] // triggered by wasm_bindgen code +// triggered by wasm_bindgen code +#![allow(clippy::drop_non_drop)] +// Triggers false positives. +// See . +#![allow(clippy::extra_unused_type_parameters)] pub mod attachment; pub mod device; diff --git a/bindings/matrix-sdk-ffi/src/lib.rs b/bindings/matrix-sdk-ffi/src/lib.rs index 094e84a128c..e6c8eb7b899 100644 --- a/bindings/matrix-sdk-ffi/src/lib.rs +++ b/bindings/matrix-sdk-ffi/src/lib.rs @@ -1,6 +1,9 @@ // TODO: target-os conditional would be good. #![allow(unused_qualifications)] +// Triggers false positives. +// See . +#![allow(clippy::extra_unused_type_parameters)] macro_rules! unwrap_or_clone_arc_into_variant { (