path_helper 0.1.2

简单易用的路径处理库
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(feature = "auto_ext")]
mod auto_ext;
#[cfg(feature = "sanitize")]
mod sanitize;
mod sync;
#[cfg(feature = "tokio")]
pub mod tokio;

#[cfg(feature = "auto_ext")]
pub use auto_ext::*;
#[cfg(feature = "sanitize")]
pub use sanitize::*;
pub use sync::*;

/// 检查扩展名是否合法
pub fn is_extension(ext: &str) -> bool {
    !ext.is_empty() && ext.len() <= 16 && ext.chars().all(|c| c.is_ascii_graphic())
}