style: simplify boolean expressions

This commit is contained in:
Daniel Eades 2022-01-04 07:52:37 +00:00 committed by Ed Page
parent e1b21784a0
commit 35d7841211

View file

@ -1610,7 +1610,7 @@ impl<'help> App<'help> {
/// ```
#[must_use]
pub fn short_flag_alias(mut self, name: char) -> Self {
assert!(!(name == '-'), "short alias name cannot be `-`");
assert!(name != '-', "short alias name cannot be `-`");
self.short_flag_aliases.push((name, false));
self
}
@ -1864,7 +1864,7 @@ impl<'help> App<'help> {
#[must_use]
pub fn visible_short_flag_aliases(mut self, names: &[char]) -> Self {
for s in names {
assert!(!(s == &'-'), "short alias name cannot be `-`");
assert!(s != &'-', "short alias name cannot be `-`");
self.short_flag_aliases.push((*s, true));
}
self