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 /ipc/src | |
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 'ipc/src')
-rw-r--r-- | ipc/src/assuan/mod.rs | 2 | ||||
-rw-r--r-- | ipc/src/gnupg.rs | 2 | ||||
-rw-r--r-- | ipc/src/sexp.rs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/ipc/src/assuan/mod.rs b/ipc/src/assuan/mod.rs index a3276210..6bbab37f 100644 --- a/ipc/src/assuan/mod.rs +++ b/ipc/src/assuan/mod.rs @@ -163,7 +163,7 @@ impl Client { let mut data = data.as_ref(); let mut request = Vec::with_capacity(data.len()); while ! data.is_empty() { - if request.len() > 0 { + if !request.is_empty() { request.push(0x0a); } write!(&mut request, "D ").unwrap(); diff --git a/ipc/src/gnupg.rs b/ipc/src/gnupg.rs index 1492345c..1d6b49bf 100644 --- a/ipc/src/gnupg.rs +++ b/ipc/src/gnupg.rs @@ -179,7 +179,7 @@ impl Context { if output.status.success() { let mut result = Vec::new(); for mut line in output.stdout.split(nl) { - if line.len() == 0 { + if line.is_empty() { // EOF. break; } diff --git a/ipc/src/sexp.rs b/ipc/src/sexp.rs index 771eee18..3d25862d 100644 --- a/ipc/src/sexp.rs +++ b/ipc/src/sexp.rs @@ -97,11 +97,11 @@ impl Sexp { } // Skip non-zero bytes. - while s.len() > 0 && s[0] > 0 { + while !s.is_empty() && s[0] > 0 { s = &s[1..]; } - if s.len() == 0 { + if s.is_empty() { return Err(Error::MalformedMPI( "Invalid DEK encoding, no zero found".into()) .into()); |