From 89c18ba2c03ff8850a3fedb2914fe811ec731075 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 4 Oct 2024 14:14:14 +0200 Subject: fix(pkgs/lf-make-map): Ensure stable sorting of the `lf` mappings --- pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pkgs') diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs index 6d9c7a0d..ba485dc2 100644 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs +++ b/pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs @@ -6,7 +6,8 @@ use super::MappingTree; impl MappingTree { pub fn to_lf_mappings(self, home_path: PathBuf) -> String { - self.iter(true) + let mut raw = self + .iter(true) .map(|(key, value)| { format!( "map g{} cd \"{}\"\n", @@ -14,6 +15,10 @@ impl MappingTree { home_path.join(&value).display() ) }) - .collect() + .collect::>(); + + raw.sort(); + + raw.into_iter().collect() } } -- cgit 1.4.1