From 0695740666fa2f17c8b4ee94868f200b9ea32559 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 12 Jan 2025 10:06:03 +0100 Subject: [PATCH] Ensure sorting when deserializing --- src/external/database/serde/deserialize.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/external/database/serde/deserialize.rs b/src/external/database/serde/deserialize.rs index 688dfc7..007099e 100644 --- a/src/external/database/serde/deserialize.rs +++ b/src/external/database/serde/deserialize.rs @@ -23,8 +23,10 @@ pub enum DeserializeDatabase { impl From for Collection { fn from(database: DeserializeDatabase) -> Self { match database { - DeserializeDatabase::V20250103(collection) => { - collection.into_iter().map(Into::into).collect() + DeserializeDatabase::V20250103(db) => { + let mut collection: Collection = db.into_iter().map(Into::into).collect(); + collection.sort_unstable(); + collection } } }