From 6c7ce6228cd7b08b4fa072b805f047b3c98f52e5 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Tue, 13 Jul 2021 22:27:44 +0200 Subject: [PATCH] Fix mistake in mapping of u8 value to Sex --- openpgp-card/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openpgp-card/src/lib.rs b/openpgp-card/src/lib.rs index c7b40fe..bb47181 100644 --- a/openpgp-card/src/lib.rs +++ b/openpgp-card/src/lib.rs @@ -145,7 +145,7 @@ pub enum DecryptMe<'a> { ECDH(&'a [u8]), } -#[derive(Debug)] +#[derive(Debug, PartialEq)] pub enum Sex { NotKnown, Male, @@ -167,9 +167,9 @@ impl Sex { impl From for Sex { fn from(s: u8) -> Self { match s { - 31 => Sex::Male, - 32 => Sex::Female, - 39 => Sex::NotApplicable, + 0x31 => Sex::Male, + 0x32 => Sex::Female, + 0x39 => Sex::NotApplicable, _ => Sex::NotKnown, } }