mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-06 21:08:48 +08:00
15 lines
322 B
Rust
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("");
|
|
}
|
|
}
|
|
}
|