diff --git a/crates/proof/src/it/grammar.rs b/crates/proof/src/it/grammar.rs index 235012bd..46302936 100644 --- a/crates/proof/src/it/grammar.rs +++ b/crates/proof/src/it/grammar.rs @@ -276,7 +276,7 @@ fn e_apostrophe(text: &str, ws: &[(usize, usize)], v: &mut Vec) { } let mut after = text.get(*b..).unwrap_or("").chars(); let Some(ap) = after.next().filter(|&c| is_apostrophe(c)) else { continue }; - let ends = after.next().is_none_or(|c| c.is_whitespace()); + let ends = after.next().is_none_or(char::is_whitespace); let quoted = text.get(..*a).and_then(|t| t.chars().next_back()).is_some_and(|c| is_apostrophe(c) || c == '‘'); if ends && !quoted { v.push(issue(*a, *b + ap.len_utf8(), "«È» si scrive con l'accento, non con l'apostrofo".into(), vec!["È".into()])); diff --git a/crates/proof/src/lib.rs b/crates/proof/src/lib.rs index 0ab16529..38f274c7 100644 --- a/crates/proof/src/lib.rs +++ b/crates/proof/src/lib.rs @@ -320,7 +320,7 @@ const COMMON: &str = "a an the and or but if of to in on at by for with from as const EXTRA_EN: &str = include_str!("../../../assets/spelling/en-extra.txt"); fn extra_words() -> &'static HashSet<&'static str> { - static E: OnceLock> = OnceLock::new(); + static E: OnceLock> = OnceLock::new(); E.get_or_init(|| EXTRA_EN.lines().map(str::trim).filter(|l| !l.is_empty() && !l.starts_with('#')).collect()) } @@ -889,7 +889,7 @@ fn grammar_en(text: &str, capital_first: bool) -> Vec { if gap == " " && (w0 == "an" || w0 == "An") && w1.chars().next().is_some_and(|c| c.is_alphabetic() && !"aeiouAEIOUhH".contains(c)) - && !w1.chars().all(|c| c.is_uppercase()) + && !w1.chars().all(char::is_uppercase) { v.push(Issue { start: *a0, diff --git a/crates/proof/src/ru/mod.rs b/crates/proof/src/ru/mod.rs index c29bbc7c..50faac38 100644 --- a/crates/proof/src/ru/mod.rs +++ b/crates/proof/src/ru/mod.rs @@ -109,7 +109,7 @@ pub fn has_dictionary() -> bool { /// Is `c` a letter of the Cyrillic script (the only one the Russian dictionary covers)? pub(crate) fn is_cyrillic(c: char) -> bool { - matches!(c, '\u{0400}'..='\u{04FF}' | '\u{0500}'..='\u{052F}') + matches!(c, '\u{0400}'..='\u{052F}') } /// Particles joined to a word with a hyphen (`кто-то`, `где-нибудь`, `давай-ка`, `всё-таки`,