diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/channel/validate.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/channel/validate.rs b/src/channel/validate.rs index 0c97293..7894e0c 100644 --- a/src/channel/validate.rs +++ b/src/channel/validate.rs @@ -1,3 +1,5 @@ +use std::ops::Not as _; + use unicode_segmentation::UnicodeSegmentation as _; use crate::name::Name; @@ -10,7 +12,7 @@ pub fn name(name: &Name) -> bool { [ display.graphemes(true).count() < NAME_TOO_LONG, - display.chars().all(|ch| !ch.is_control()), + display.chars().any(char::is_control).not(), display.chars().next().is_some_and(|c| !c.is_whitespace()), display.chars().last().is_some_and(|c| !c.is_whitespace()), display |
