From 431679590835eec0805094a836168f881c60c372 Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:12:40 +1200 Subject: [PATCH] Use BTreeMap instead of HashMap for checks file to order the output --- rosey/src/runners/checker.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rosey/src/runners/checker.rs b/rosey/src/runners/checker.rs index c66abb5..2c1b665 100644 --- a/rosey/src/runners/checker.rs +++ b/rosey/src/runners/checker.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; use std::{ - collections::{BTreeMap, HashMap}, + collections::BTreeMap, fs::{create_dir_all, read_to_string, File}, io::{BufWriter, Write}, str::FromStr, @@ -10,7 +10,7 @@ use globwalk::DirEntry; use crate::{RoseyLocale, RoseyOptions, RoseyTranslation}; -#[derive(Serialize, Deserialize, Hash, PartialEq, Eq)] +#[derive(Serialize, Deserialize, Hash, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "camelCase")] enum RoseyCheckStates { Current, @@ -25,8 +25,8 @@ struct RoseyCheck { current: bool, base_total: i32, total: i32, - states: HashMap, - keys: HashMap, + states: BTreeMap, + keys: BTreeMap, } pub struct RoseyChecker {