mirror of
https://github.com/Portabase/agent.git
synced 2026-09-10 01:57:10 +00:00
16 lines
336 B
Rust
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()
|
|
}
|
|
|