diff options
Diffstat (limited to 'sys/nixpkgs/pkgs/lf-make-map/src/generator/mod.rs')
-rw-r--r-- | sys/nixpkgs/pkgs/lf-make-map/src/generator/mod.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/nixpkgs/pkgs/lf-make-map/src/generator/mod.rs b/sys/nixpkgs/pkgs/lf-make-map/src/generator/mod.rs index 48df027f..c03b33dc 100644 --- a/sys/nixpkgs/pkgs/lf-make-map/src/generator/mod.rs +++ b/sys/nixpkgs/pkgs/lf-make-map/src/generator/mod.rs @@ -1,10 +1,10 @@ use std::path::PathBuf; use anyhow::{Context, Result}; -use log::{debug, info, trace}; +use log::trace; use walkdir::{DirEntry, WalkDir}; -use crate::mapping::{map_tree::MappingTree, Mapping}; +use crate::mapping::{map_tree::MappingTree, MapKey, Mapping}; pub struct MappingsGenerator { mappings: MappingTree, @@ -35,9 +35,15 @@ impl MappingsGenerator { trace!("Processed '{}'..", directory.path().display()); let mapping = Mapping::new(&home_path, directory.path().to_path_buf()); - mappings - .insert(&mapping.key.clone(), mapping) - .context("Failed to insert a key")?; + let mapping_key = mapping.key.clone(); + mappings.insert(&mapping_key, mapping).with_context(|| { + format!( + "Failed to insert '{}' for path: '{}'\nMapTree is now: \n{}", + MapKey::display(&mapping_key), + directory.path().display(), + mappings, + ) + })?; } } todo!() |