We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e509eda commit 3074bc6Copy full SHA for 3074bc6
agent-control/src/config_migrate/migration/converter.rs
@@ -118,9 +118,11 @@ fn retrieve_dir_mapping_values<F: FileReader>(
118
.filter(|p| dir_info.valid_filename(p));
119
120
let mut read_files = valid_extension_files.map(|filepath| {
121
- file_reader
122
- .read(&filepath)
123
- .map(|content| (filepath, content))
+ file_reader.read(&filepath).map(|content| {
+ // If I am here means read was successful (it was a file), so I can unwrap `file_name`.
+ let filename = filepath.file_name().unwrap().to_string_lossy().to_string();
124
+ (filename, content)
125
+ })
126
});
127
128
let read_files = read_files.try_fold(HashMap::new(), |mut acc, read_file| {
0 commit comments