Files
msg-tool/src/ext/path.rs
2025-09-03 22:59:22 +08:00

15 lines
322 B
Rust

//! Extensions for std::path
pub trait PathBufExt {
/// Remove all extensions from the path.
fn remove_all_extensions(&mut self);
}
impl PathBufExt for std::path::PathBuf {
fn remove_all_extensions(&mut self) {
while self.extension().is_some() {
self.set_extension("");
}
}
}