Files
Portabase.Agent/src/utils/file.rs
T
charlesgauthereau 24ab764a6f First Commit.
2026-01-03 23:55:47 +01:00

16 lines
336 B
Rust

use std::path::Path;
pub fn full_extension(path: &Path) -> String {
path.file_name()
.and_then(|name| name.to_str())
.map(|name| {
match name.find('.') {
Some(idx) => &name[idx..],
None => "",
}
})
.unwrap_or_default()
.to_string()
}