summaryrefslogtreecommitdiffstats
path: root/openpgp/src/armor.rs
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2021-04-07 17:52:18 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2021-04-09 13:13:59 +0200
commitbaecfecbf953aa9e40f16084b927f35b69efc8f0 (patch)
treebac7c53d32187d6eff22d231dd556b4ada40d50f /openpgp/src/armor.rs
parent4d7ecc72b384a9c30e7024eb2ebfaede9882db06 (diff)
Lint: Use matches! macro.
- https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
Diffstat (limited to 'openpgp/src/armor.rs')
-rw-r--r--openpgp/src/armor.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs
index 3ac9886a..1ba52ae9 100644
--- a/openpgp/src/armor.rs
+++ b/openpgp/src/armor.rs
@@ -884,14 +884,12 @@ impl<'a> Reader<'a> {
lines += 1;
// Ignore leading whitespace, etc.
- while match self.source.data_hard(1)?[0] {
+ while matches!(self.source.data_hard(1)?[0],
// Skip some whitespace (previously .is_ascii_whitespace())
- b' ' | b'\t' | b'\r' | b'\n' => true,
+ b' ' | b'\t' | b'\r' | b'\n' |
// Also skip common quote characters
- b'>' | b'|' | b']' | b'}' => true,
- // Do not skip anything else
- _ => false,
- } {
+ b'>' | b'|' | b']' | b'}' )
+ {
let c = self.source.data(1)?[0];
if c == b'\n' {
// We found a newline while walking whitespace, reset prefix