mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
style: simplify boolean expressions
This commit is contained in:
parent
e1b21784a0
commit
35d7841211
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue