summaryrefslogtreecommitdiffstats
path: root/sqv
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-04-07 20:23:44 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2021-04-09 13:13:59 +0200
commit19169b76117db8b1d81f1aafa64a5440d042803d (patch)
treebdd07c05920f6217bd1512e6dc56c1d8fb1da6bf /sqv
parent694680ae3b2192c102f1b9a4d342677545cac629 (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 'sqv')
-rw-r--r--sqv/build.rs2
-rw-r--r--sqv/src/sqv.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/sqv/build.rs b/sqv/build.rs
index d638eea5..fceb4d55 100644
--- a/sqv/build.rs
+++ b/sqv/build.rs
@@ -66,7 +66,7 @@ fn dump_help(sink: &mut dyn io::Write,
writeln!(sink, "//! ```text")?;
for line in help.trim_end().split("\n").skip(1) {
- if line == "" {
+ if line.is_empty() {
writeln!(sink, "//!")?;
} else {
writeln!(sink, "//! {}", line.trim_end())?;
diff --git a/sqv/src/sqv.rs b/sqv/src/sqv.rs
index 2ba9765a..a9828ee0 100644
--- a/sqv/src/sqv.rs
+++ b/sqv/src/sqv.rs
@@ -98,7 +98,7 @@ impl<'a> VerificationHelper for VHelper<'a> {
let (certs, errs) = certs.into_iter().fold(
(Vec::with_capacity(count), Vec::new()),
|(mut certs, mut errs), a| {
- if certs.len() == 0 {
+ if certs.is_empty() {
certs.push(a);
} else if certs[certs.len() - 1].fingerprint() == a.fingerprint() {
// Merge `a` into the last element.
@@ -113,7 +113,7 @@ impl<'a> VerificationHelper for VHelper<'a> {
(certs, errs)
});
- if errs.len() > 0 {
+ if !errs.is_empty() {
eprintln!("Error merging duplicate keys:");
for err in errs.iter() {
eprintln!(" {}", err);