mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
18 lines
261 B
Rust
18 lines
261 B
Rust
#[derive(Clone, Copy, PartialEq, Eq)]
|
|
pub enum CharKind {
|
|
Space,
|
|
Punct,
|
|
Other,
|
|
}
|
|
|
|
impl CharKind {
|
|
pub fn new(c: char) -> Self {
|
|
if c.is_whitespace() {
|
|
Self::Space
|
|
} else if c.is_ascii_punctuation() {
|
|
Self::Punct
|
|
} else {
|
|
Self::Other
|
|
}
|
|
}
|
|
}
|