about summary refs log tree commit diff
path: root/src/string.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2019-04-11 13:48:13 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2019-04-11 13:48:13 +0200
commit4352681d624bcbfb9d5aa9d2f5057091622402a6 (patch)
tree8f29b9f5722b9330192f7451623702fffeb598b1 /src/string.rs
parent896394a7a5fdec00851f4034cff98574456d23aa (diff)
fix clippy warnings
clippy::needless_return
clippy::redundant_closure
clippy::or_fun_call
clippy::len_zero
clippy::expect_fun_call
clippy::assertions_on_constants
clippy::identity_conversion
clippy::chars_last_cmp
Diffstat (limited to 'src/string.rs')
-rw-r--r--src/string.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/string.rs b/src/string.rs
index 8b910c0b4ce..14220ba5d79 100644
--- a/src/string.rs
+++ b/src/string.rs
@@ -338,11 +338,13 @@ fn is_new_line(grapheme: &str) -> bool {
 }
 
 fn is_whitespace(grapheme: &str) -> bool {
-    grapheme.chars().all(|c| c.is_whitespace())
+    grapheme.chars().all(char::is_whitespace)
 }
 
 fn is_punctuation(grapheme: &str) -> bool {
-    grapheme.chars().all(|c| c.is_punctuation_other())
+    grapheme
+        .chars()
+        .all(UnicodeCategories::is_punctuation_other)
 }
 
 fn graphemes_width(graphemes: &[&str]) -> usize {