diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-04 14:14:14 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-04 14:14:14 +0200 |
commit | 89c18ba2c03ff8850a3fedb2914fe811ec731075 (patch) | |
tree | 518cccff45802cf20de98591fdd26b6f5a3dd218 /pkgs/by-name/lf/lf-make-map/src/mapping | |
parent | fix(pkgs/con2pdf): Avoid using deprecated `convert` command (diff) | |
download | nixos-config-89c18ba2c03ff8850a3fedb2914fe811ec731075.tar.gz nixos-config-89c18ba2c03ff8850a3fedb2914fe811ec731075.zip |
fix(pkgs/lf-make-map): Ensure stable sorting of the `lf` mappings
Diffstat (limited to 'pkgs/by-name/lf/lf-make-map/src/mapping')
-rw-r--r-- | pkgs/by-name/lf/lf-make-map/src/mapping/map_tree/lf_mapping.rs | 9 |
1 files changed, 7 insertions, 2 deletions
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::<Vec<String>>(); + + raw.sort(); + + raw.into_iter().collect() } } |