mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-09 06:18:46 +08:00
Add a new option
This commit is contained in:
@@ -3,6 +3,7 @@ pub mod atomic;
|
||||
#[cfg(feature = "fancy-regex")]
|
||||
pub mod fancy_regex;
|
||||
pub mod io;
|
||||
pub mod path;
|
||||
#[cfg(feature = "emote-psb")]
|
||||
pub mod psb;
|
||||
#[cfg(feature = "markup5ever_rcdom")]
|
||||
|
||||
14
src/ext/path.rs
Normal file
14
src/ext/path.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
//! 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("");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user