From 377b8ea75a371f31e39d8a8f8fa5c5a5687793da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 19 Jan 2021 10:19:15 +0100 Subject: [PATCH] crypto: Use consistent ordering for the group session sharing log line --- matrix_sdk_crypto/src/session_manager/group_sessions.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix_sdk_crypto/src/session_manager/group_sessions.rs b/matrix_sdk_crypto/src/session_manager/group_sessions.rs index ff8702b0..c0d66e57 100644 --- a/matrix_sdk_crypto/src/session_manager/group_sessions.rs +++ b/matrix_sdk_crypto/src/session_manager/group_sessions.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::{ - collections::{BTreeMap, HashMap, HashSet}, + collections::{BTreeMap, BTreeSet, HashMap, HashSet}, sync::Arc, }; @@ -313,10 +313,10 @@ impl GroupSessionManager { info!( "Sharing outbound session at index {} with {:?}", outbound.message_index().await, - devices.iter().fold(HashMap::new(), |mut acc, d| { + devices.iter().fold(BTreeMap::new(), |mut acc, d| { acc.entry(d.user_id()) - .or_insert_with(Vec::new) - .push(d.device_id()); + .or_insert_with(BTreeSet::new) + .insert(d.device_id()); acc }) );