diff options
author | Igor Matuszewski <igor@sequoia-pgp.org> | 2020-10-06 16:00:56 +0200 |
---|---|---|
committer | Igor Matuszewski <xanewok@gmail.com> | 2020-10-06 20:41:07 +0000 |
commit | 7940193f750791e500588b32f2d106f7b360f4a5 (patch) | |
tree | 4ecbad3626cb200ad7680fd7f2b02a8713f615d6 | |
parent | 52ee6a8fa2d326ba93fd4cbcf134a231bc438d95 (diff) |
openpgp: Remove one unreachable thanks to newer match exhaustive checks
-rw-r--r-- | openpgp/src/crypto/mem.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/openpgp/src/crypto/mem.rs b/openpgp/src/crypto/mem.rs index 5418286c..3000f00b 100644 --- a/openpgp/src/crypto/mem.rs +++ b/openpgp/src/crypto/mem.rs @@ -296,10 +296,9 @@ pub fn secure_cmp(a: &[u8], b: &[u8]) -> Ordering { memsec::memcmp(a.as_ptr(), b.as_ptr(), min(a.len(), b.len())) }; let ord2 = match ord2 { + 1..=i32::MAX => Ordering::Greater, 0 => Ordering::Equal, - a if a < 0 => Ordering::Less, - a if a > 0 => Ordering::Greater, - _ => unreachable!(), + i32::MIN..=-1 => Ordering::Less, }; if ord1 == Ordering::Equal { ord2 } else { ord1 } |