diff --git a/src/main.rs b/src/main.rs index 7e02bf8e0d866992a9f87b1dad5108e18fabfef1..498468590941f98334068ee379b80b3631d4ec5a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1044,16 +1044,12 @@ fn shortlog(commits: &mut [Commit]) -> String { s } -fn ascii_isalnum(c: char) -> bool { - (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') -} - fn sanitize_summary(summary: &str) -> String { let mut s = String::with_capacity(summary.len()); let mut prev_dot = false; let mut need_space = false; for c in summary.chars() { - if ascii_isalnum(c) || c == '_' || c == '.' { + if c.is_ascii_alphanumeric() || c == '_' || c == '.' { if need_space { s.push('-'); need_space = false;