chore: add for_loops_forbidden_only parser and switch to fat LTO in release profile

This commit is contained in:
JestDotty
2025-10-04 13:58:40 +00:00
parent 93cf77cb96
commit 8c5938786e
7 changed files with 54 additions and 128 deletions
+4 -6
View File
@@ -11,7 +11,7 @@ pub fn parse(stats: &mut Stats, text: &str) {
{
stats.sentence_count += 1;
for word in sentence
.split_whitespace()
.split_ascii_whitespace()
.map(|s| s.trim())
.filter(|s| !s.is_empty())
{
@@ -21,17 +21,15 @@ pub fn parse(stats: &mut Stats, text: &str) {
for char in word.chars() {
if char.is_numeric() {
stats.numeric_count += 1;
//TODO are numbers capitalized or not? I don't know!
}
if !char.is_ascii_uppercase() {
all_capitalized = false;
} else if !char.is_ascii_uppercase() {
all_capitalized = false;
}
}
if all_capitalized {
stats.capitalized_count += 1;
}
let lowercase_word = word.to_lowercase();
if FORBIDDEN_WORDS.contains(&lowercase_word) {
if FORBIDDEN_WORDS.contains(&word.to_lowercase()) {
stats.forbidden_count += 1;
}
}