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/packet | |
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/packet')
-rw-r--r-- | openpgp/src/packet/user_attribute.rs | 2 | ||||
-rw-r--r-- | openpgp/src/packet/userid.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/packet/user_attribute.rs b/openpgp/src/packet/user_attribute.rs index 57d93e82..30249d58 100644 --- a/openpgp/src/packet/user_attribute.rs +++ b/openpgp/src/packet/user_attribute.rs @@ -172,7 +172,7 @@ impl<'a> Iterator for SubpacketIterator<'a> { Err(e) => return Some(Err(e.into())), }; - if raw.len() == 0 { + if raw.is_empty() { return Some(Err(Error::MalformedPacket( "Subpacket without type octet".into()).into())); } diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index 028e9f73..2994f23e 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -627,7 +627,7 @@ impl UserID { } } - if value.len() > 0 { + if !value.is_empty() { value.push_str(" "); } value.push_str("("); @@ -655,7 +655,7 @@ impl UserID { } } - let something = value.len() > 0; + let something = !value.is_empty(); if something { value.push_str(" <"); } |