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 entry: DirEntry = entry?;
|
||||||
let scanned = scan_with_progress_bar(&entry.path(), progress_bar, one_filesystem)?;
|
let scanned = scan_with_progress_bar(&entry.path(), progress_bar, one_filesystem)?;
|
||||||
if let Some(scanned) = scanned {
|
if let Some(scanned) = scanned {
|
||||||
children.insert(
|
if let Ok(filename) = entry.file_name().into_string() {
|
||||||
entry
|
children.insert(filename, scanned);
|
||||||
.file_name()
|
} else {
|
||||||
.into_string()
|
warn!("Non-UTF-8 filename; ignoring: {:?}", entry.file_name())
|
||||||
.expect("OsString not String"),
|
}
|
||||||
scanned,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user