diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-07 20:23:44 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-09 13:13:59 +0200 |
commit | 19169b76117db8b1d81f1aafa64a5440d042803d (patch) | |
tree | bdd07c05920f6217bd1512e6dc56c1d8fb1da6bf /sq/src/commands/certify.rs | |
parent | 694680ae3b2192c102f1b9a4d342677545cac629 (diff) |
Lint: Use is_empty().
- https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
- https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
Diffstat (limited to 'sq/src/commands/certify.rs')
-rw-r--r-- | sq/src/commands/certify.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sq/src/commands/certify.rs b/sq/src/commands/certify.rs index 8779e5e3..746737b8 100644 --- a/sq/src/commands/certify.rs +++ b/sq/src/commands/certify.rs @@ -30,7 +30,7 @@ pub fn certify(config: Config, m: &clap::ArgMatches) .map(|s| s.parse()).unwrap_or(Ok(120))?; let regex = m.values_of("regex").map(|v| v.collect::<Vec<_>>()) .unwrap_or_default(); - if trust_depth == 0 && regex.len() > 0 { + if trust_depth == 0 && !regex.is_empty() { return Err( anyhow::format_err!("A regex only makes sense \ if the trust depth is greater than 0")); @@ -123,7 +123,7 @@ pub fn certify(config: Config, m: &clap::ArgMatches) while let Some(name) = n.next() { let value = n.next().unwrap(); - let (critical, name) = if name.len() > 0 + let (critical, name) = if !name.is_empty() && Some('!') == name.chars().next() { (true, &name[1..]) |