diff options
author | qkzk <qu3nt1n@gmail.com> | 2022-12-22 22:24:00 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2022-12-22 22:24:00 +0100 |
commit | 232680bd4d8e8f0146cd220f3bbf1e9b7661e159 (patch) | |
tree | 19518176e76f07ec944e3082f267bb2d6eaf67b1 /src/marks.rs | |
parent | 91725d8bf16e10b09db16bfe51e92b0238866dff (diff) |
hold marks in BTreeMap to maintain order by char and improve the display
Diffstat (limited to 'src/marks.rs')
-rw-r--r-- | src/marks.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/marks.rs b/src/marks.rs index d36e4ed..d662e9e 100644 --- a/src/marks.rs +++ b/src/marks.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use std::collections::BTreeMap; use std::fs::File; use std::io::{self, BufRead, BufWriter, Write}; use std::path::{Path, PathBuf}; @@ -12,7 +12,7 @@ use crate::fm_error::{FmError, FmResult}; /// It's a map between any char (except :) and a PathBuf. pub struct Marks { save_path: PathBuf, - marks: HashMap<char, PathBuf>, + marks: BTreeMap<char, PathBuf>, } impl Marks { @@ -25,7 +25,7 @@ impl Marks { } fn read_from_file(save_path: PathBuf) -> Self { - let mut marks = HashMap::new(); + let mut marks = BTreeMap::new(); let mut must_save = false; if let Ok(lines) = read_lines(&save_path) { for line in lines { |