Fix new clippy lints for Rust 1.65

This commit is contained in:
Heiko Schaefer 2022-11-07 16:42:37 +01:00
parent b80b86b201
commit 4d94386b82
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
4 changed files with 7 additions and 5 deletions

View file

@ -779,7 +779,8 @@ impl Card<Admin<'_, '_>> {
// 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:

View file

@ -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);

View file

@ -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);

View file

@ -230,7 +230,8 @@ pub(crate) fn print_gnuk_note(err: Error, card: &Card<Transaction>) -> 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."