|
|
|
@ -1,10 +1,11 @@
|
|
|
|
|
use std::ffi::OsStr; |
|
|
|
|
use std::path::Path; |
|
|
|
|
|
|
|
|
|
fn extract<'a>( |
|
|
|
|
path: &'a Path, |
|
|
|
|
current_name: Option<&'a str>, |
|
|
|
|
) -> Option<(&'a Path, Option<&'a str>)> { |
|
|
|
|
let name = path.file_name().map(|x| x.to_str()).flatten(); |
|
|
|
|
let name = path.file_name().map(OsStr::to_str).flatten(); |
|
|
|
|
let parent = path.parent()?; |
|
|
|
|
|
|
|
|
|
// println!("path={path:?}, current_name={current_name:?}, parent={parent:?}, name={name:?}");
|
|
|
|
|