Ignore non-UTF-8 file names instead of panicking
ci/woodpecker/push/build Pipeline is pending Details
ci/woodpecker/push/release Pipeline is pending Details
ci/woodpecker/tag/build Pipeline failed Details
ci/woodpecker/tag/release Pipeline was successful Details

This commit is contained in:
Olivier 'reivilibre' 2022-07-23 21:55:04 +01:00
parent 0b84c793bf
commit 05c6d3e662
1 changed files with 5 additions and 7 deletions

View File

@ -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())
}
}
}