msg_tool\ext/path.rs
1//! Extensions for std::path
2
3pub trait PathBufExt {
4 /// Remove all extensions from the path.
5 fn remove_all_extensions(&mut self);
6}
7
8impl PathBufExt for std::path::PathBuf {
9 fn remove_all_extensions(&mut self) {
10 while self.extension().is_some() {
11 self.set_extension("");
12 }
13 }
14}