Ensure sorting when deserializing
All checks were successful
Cargo CI / Build and Test (pull_request) Successful in 2m10s
Cargo CI / Lint (pull_request) Successful in 1m8s

This commit is contained in:
Wojciech Kozlowski 2025-01-12 10:06:03 +01:00
parent 21ba413df4
commit 0695740666

View File

@ -23,8 +23,10 @@ pub enum DeserializeDatabase {
impl From<DeserializeDatabase> 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
}
}
}