Ignore non-UTF-8 file names instead of panicking
This commit is contained in:
parent
0b84c793bf
commit
05c6d3e662
|
@ -307,13 +307,11 @@ pub fn scan_with_progress_bar(
|
|||
let entry: DirEntry = entry?;
|
||||
let scanned = scan_with_progress_bar(&entry.path(), progress_bar, one_filesystem)?;
|
||||
if let Some(scanned) = scanned {
|
||||
children.insert(
|
||||
entry
|
||||
.file_name()
|
||||
.into_string()
|
||||
.expect("OsString not String"),
|
||||
scanned,
|
||||
);
|
||||
if let Ok(filename) = entry.file_name().into_string() {
|
||||
children.insert(filename, scanned);
|
||||
} else {
|
||||
warn!("Non-UTF-8 filename; ignoring: {:?}", entry.file_name())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue