diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-06 20:18:46 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-06 20:18:46 +0800 |
| commit | 10bf8bdfe09e3ab80edcd45b9018b1412ef14f64 (patch) | |
| tree | 985217a8a489fc2873b589df9e90aa7f750260ac /mingling/src/parser/args.rs | |
| parent | bd9d4006b6e97f26dfb732899a4c4d839558917c (diff) | |
Replace length checks with `is_empty` and `?` operator
Diffstat (limited to 'mingling/src/parser/args.rs')
| -rw-r--r-- | mingling/src/parser/args.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mingling/src/parser/args.rs b/mingling/src/parser/args.rs index f795b54..2a07e97 100644 --- a/mingling/src/parser/args.rs +++ b/mingling/src/parser/args.rs @@ -72,12 +72,12 @@ impl Argument { where F: Into<Flag>, { - if self.len() < 1 { + if self.is_empty() { return None; } let flag: Flag = flag.into(); - if flag.len() > 0 { + if !flag.is_empty() { // Has any flag for argument in flag.iter() { let value = special_argument!(self.vec, argument); @@ -99,12 +99,12 @@ impl Argument { { let mut str_result = Vec::new(); - if self.len() < 1 { + if self.is_empty() { return str_result; } let flag: Flag = flag.into(); - if flag.len() < 1 { + if flag.is_empty() { let value = special_arguments!(self.vec, ""); str_result.extend(value); } else { @@ -122,12 +122,12 @@ impl Argument { where F: Into<Flag>, { - if self.len() < 1 { + if self.is_empty() { return false; } let flag: Flag = flag.into(); - if flag.len() > 0 { + if !flag.is_empty() { // Has any flag for argument in flag.iter() { let enabled = special_flag!(self.vec, argument); |
