From feb51a56537cbf9ac40a1f3fa2fa070c68e4be5d Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 21 May 2024 14:34:30 +0900 Subject: [PATCH] replace HashMap with BTreeMap in Storages and Backups to produce cleaner git log --- src/backups.rs | 6 +++--- src/storages.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backups.rs b/src/backups.rs index c312949..fbb4c1f 100644 --- a/src/backups.rs +++ b/src/backups.rs @@ -3,7 +3,7 @@ use core::panic; use std::{ - collections::HashMap, + collections::BTreeMap, fs, io, path::{Path, PathBuf}, }; @@ -202,14 +202,14 @@ impl Backup { #[derive(Debug, Serialize, Deserialize)] pub struct Backups { - pub list: HashMap, + pub list: BTreeMap, } impl Backups { /// Empty [`Backups`]. pub fn new() -> Backups { Backups { - list: HashMap::new(), + list: BTreeMap::new(), } } diff --git a/src/storages.rs b/src/storages.rs index b67b9cf..fd02ef3 100644 --- a/src/storages.rs +++ b/src/storages.rs @@ -9,7 +9,7 @@ use anyhow::{anyhow, Context, Result}; use clap::ValueEnum; use core::panic; use serde::{Deserialize, Serialize}; -use std::{collections::HashMap, fmt, fs, io, path, u64}; +use std::{collections::BTreeMap, fmt, fs, io, path, u64}; /// YAML file to store known storages.. pub const STORAGESFILE: &str = "storages.yml"; @@ -157,14 +157,14 @@ pub mod physical_drive_partition; #[derive(Debug, Serialize, Deserialize)] pub struct Storages { - pub list: HashMap, + pub list: BTreeMap, } impl Storages { /// Construct empty [`Storages`] pub fn new() -> Storages { Storages { - list: HashMap::new(), + list: BTreeMap::new(), } }