INNER CODE UNIT · Rust

get_filename

David-OConnor/plascad · src/file_io/mod.rs:100

fn get_filename(path: &Path) -> String {
    if let Some(file_name) = path.file_stem() {
        file_name
            .to_str()
            .map(|s| s.to_string())
            .unwrap_or_default()
    } else {
        String::new()
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…