diff --git a/datman/src/tree.rs b/datman/src/tree.rs index 48645c0..0f6b46d 100644 --- a/datman/src/tree.rs +++ b/datman/src/tree.rs @@ -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()) + } } }