diff --git a/crates/bibclean/src/author.rs b/crates/bibclean/src/author.rs index 91286c1..ce83f13 100644 --- a/crates/bibclean/src/author.rs +++ b/crates/bibclean/src/author.rs @@ -375,7 +375,11 @@ fn normalise_isbn(raw: &str) -> Option { /// Whether a character is a digit, by Python's definition — which counts the /// superscripts and the circled numbers that a decimal test does not. fn is_digit(c: char) -> bool { - c.to_digit(10).is_some() + // Not `is_ascii_digit`: a decimal digit in any script is a digit, and a + // name carrying one is not a name whichever script it is written in. + #[allow(clippy::is_digit_ascii_radix)] + let decimal = c.is_digit(10); + decimal || DIGIT_RANGES .iter() .any(|(from, to)| (*from..=*to).contains(&c)) diff --git a/parity/tests/author.rs b/parity/tests/author.rs index 015b3bd..63b6466 100644 --- a/parity/tests/author.rs +++ b/parity/tests/author.rs @@ -51,19 +51,19 @@ fn every_author_judgement_matches_python() { }; let ours = list(&bibclean::author::from_front_matter(front.unwrap_or(""))); - if &ours != &theirs["front_matter"] { + if ours != theirs["front_matter"] { differs("front_matter", ours.to_string(), &theirs["front_matter"]); } let ours = list(&bibclean::author::from_title(title)); - if &ours != &theirs["title"] { + if ours != theirs["title"] { differs("title", ours.to_string(), &theirs["title"]); } let ours = bibclean::author::best(title, front) .as_ref() .map_or(Value::Null, as_value); - if &ours != &theirs["best"] { + if ours != theirs["best"] { differs("best", ours.to_string(), &theirs["best"]); }