Browse Source

Prettier map

master
Julio Biason 6 months ago
parent
commit
7803c58e38
  1. 3
      pathextractiontest/src/main.rs

3
pathextractiontest/src/main.rs

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

Loading…
Cancel
Save