From feb6f3156135c950f9eb4b1d8c2a792848390954 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 13 Oct 2019 22:03:02 +0200 Subject: [PATCH] Use new char::is_ascii_alphanumeric function --- src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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;