Fix case where doc_markdown is triggered on words ending with "ified"

This commit is contained in:
Guillaume Gomez 2024-07-26 11:12:35 +02:00
parent 345c94c98f
commit 760c3fab4f

View file

@ -92,6 +92,10 @@ fn check_word(cx: &LateContext<'_>, word: &str, span: Span, code_level: isize, b
&& matches!(prefix.chars().last(), Some('S' | 'X')) && matches!(prefix.chars().last(), Some('S' | 'X'))
{ {
prefix prefix
} else if let Some(prefix) = s.strip_suffix("ified")
&& prefix.chars().all(|c| c.is_ascii_uppercase())
{
prefix
} else { } else {
s.strip_suffix('s').unwrap_or(s) s.strip_suffix('s').unwrap_or(s)
}; };