refactor: improve tokenzie

pull/509/head
sigoden 3 weeks ago
parent a75aef459d
commit 5883a0685a

@ -36,7 +36,8 @@ pub fn get_env_name(key: &str) -> String {
pub fn tokenize(text: &str) -> Vec<&str> {
if text.is_ascii() {
text.split_whitespace().collect()
text.split_inclusive(|c: char| c.is_ascii_whitespace())
.collect()
} else {
unicode_segmentation::UnicodeSegmentation::graphemes(text, true).collect()
}

Loading…
Cancel
Save