diff --git a/clap_derive/src/utils/doc_comments.rs b/clap_derive/src/utils/doc_comments.rs index 5c54d38bc2b..a1c0984e3a9 100644 --- a/clap_derive/src/utils/doc_comments.rs +++ b/clap_derive/src/utils/doc_comments.rs @@ -139,8 +139,8 @@ fn is_list_item(s: &str) -> bool { } let mut chars = s.chars(); - chars.next().map_or(false, |c| c.is_digit(10)) - && chars.skip_while(|c| c.is_digit(10)).next() == Some('.') + chars.next().map(|c| c.is_ascii_digit()).unwrap_or(false) + && chars.find(|c| !c.is_ascii_digit()) == Some('.') } fn merge_lines(lines: impl IntoIterator>) -> String {