diff --git a/openpgp-card-sequoia/src/lib.rs b/openpgp-card-sequoia/src/lib.rs index f2284b5..6928b23 100644 --- a/openpgp-card-sequoia/src/lib.rs +++ b/openpgp-card-sequoia/src/lib.rs @@ -779,7 +779,8 @@ impl Card> { // Check for max len let ec = self.state.tx.extended_capabilities()?; - if ec.max_len_special_do() == None || url.len() <= ec.max_len_special_do().unwrap() as usize + if ec.max_len_special_do().is_none() + || url.len() <= ec.max_len_special_do().unwrap() as usize { // If we don't know the max length for URL ("special DO"), // or if it's within the acceptable length: diff --git a/openpgp-card/src/algorithm.rs b/openpgp-card/src/algorithm.rs index c063b47..0e81124 100644 --- a/openpgp-card/src/algorithm.rs +++ b/openpgp-card/src/algorithm.rs @@ -201,7 +201,7 @@ impl Algo { let mut algo_attributes = vec![0x01]; // Length of modulus n in bit - algo_attributes.extend(&algo_attrs.len_n().to_be_bytes()); + algo_attributes.extend(algo_attrs.len_n().to_be_bytes()); // Length of public exponent e in bit algo_attributes.push(0x00); diff --git a/pcsc/src/lib.rs b/pcsc/src/lib.rs index c7b93f1..1258c45 100644 --- a/pcsc/src/lib.rs +++ b/pcsc/src/lib.rs @@ -302,7 +302,7 @@ impl CardTransaction for PcscTransaction<'_> { ]; // 15 ulDataLength ULONG length of Data to be sent to the ICC - send.extend(&(ab_data.len() as u32).to_le_bytes()); + send.extend((ab_data.len() as u32).to_le_bytes()); // 19 abData BYTE[] Data to send to the ICC send.extend(ab_data); @@ -405,7 +405,7 @@ impl CardTransaction for PcscTransaction<'_> { ]; // 15 ulDataLength ULONG length of Data to be sent to the ICC - send.extend(&(ab_data.len() as u32).to_le_bytes()); + send.extend((ab_data.len() as u32).to_le_bytes()); // 19 abData BYTE[] Data to send to the ICC send.extend(ab_data); diff --git a/tools/src/util.rs b/tools/src/util.rs index 6e3e08d..af846e1 100644 --- a/tools/src/util.rs +++ b/tools/src/util.rs @@ -230,7 +230,8 @@ pub(crate) fn print_gnuk_note(err: Error, card: &Card) -> Result<() ) { // check if no keys exist on the card let fps = card.fingerprints()?; - if fps.signature() == None && fps.decryption() == None && fps.authentication() == None { + if fps.signature().is_none() && fps.decryption().is_none() && fps.authentication().is_none() + { println!( "\nNOTE: Some cards (e.g. Gnuk) don't allow \ User PIN change while no keys exist on the card."