replace HashMap with BTreeMap in Storages and Backups

to produce cleaner git log
This commit is contained in:
qwjyh 2024-05-21 14:34:30 +09:00
parent 6f8a71fe8d
commit feb51a5653
2 changed files with 6 additions and 6 deletions

View file

@ -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<String, Backup>,
pub list: BTreeMap<String, Backup>,
}
impl Backups {
/// Empty [`Backups`].
pub fn new() -> Backups {
Backups {
list: HashMap::new(),
list: BTreeMap::new(),
}
}

View file

@ -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<String, Storage>,
pub list: BTreeMap<String, Storage>,
}
impl Storages {
/// Construct empty [`Storages`]
pub fn new() -> Storages {
Storages {
list: HashMap::new(),
list: BTreeMap::new(),
}
}