First one-shot pass

This commit is contained in:
2026-02-10 14:29:23 -05:00
parent 739d79d6a2
commit f65e3d8413
48 changed files with 5409 additions and 2 deletions

20
src/engine/filter.rs Normal file
View File

@@ -0,0 +1,20 @@
pub struct CharFilter {
pub allowed: Vec<char>,
}
impl CharFilter {
pub fn new(allowed: Vec<char>) -> Self {
Self { allowed }
}
pub fn is_allowed(&self, ch: char) -> bool {
self.allowed.contains(&ch) || ch == ' '
}
#[allow(dead_code)]
pub fn filter_text(&self, text: &str) -> String {
text.chars()
.filter(|&ch| self.is_allowed(ch))
.collect()
}
}