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 /openpgp/src/serialize/stream.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 'openpgp/src/serialize/stream.rs')
-rw-r--r-- | openpgp/src/serialize/stream.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index 1bc4b507..84a6bfa4 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -1255,7 +1255,7 @@ impl<'a> Signer<'a> { /// ``` pub fn build(mut self) -> Result<Message<'a>> { - assert!(self.signers.len() > 0, "The constructor adds a signer."); + assert!(!self.signers.is_empty(), "The constructor adds a signer."); assert!(self.inner.is_some(), "The constructor adds an inner writer."); match self.mode { @@ -1364,7 +1364,7 @@ impl<'a> Write for Signer<'a> { // Shortcut empty writes. This is important for the code // below that delays hashing newlines when creating cleartext // signed messages. - if buf.len() == 0 { + if buf.is_empty() { return Ok(0); } |