Fix new clippy lints for Rust 1.65
This commit is contained in:
parent
b80b86b201
commit
4d94386b82
4 changed files with 7 additions and 5 deletions
|
@ -779,7 +779,8 @@ impl Card<Admin<'_, '_>> {
|
||||||
// Check for max len
|
// Check for max len
|
||||||
let ec = self.state.tx.extended_capabilities()?;
|
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"),
|
// If we don't know the max length for URL ("special DO"),
|
||||||
// or if it's within the acceptable length:
|
// or if it's within the acceptable length:
|
||||||
|
|
|
@ -201,7 +201,7 @@ impl Algo {
|
||||||
let mut algo_attributes = vec![0x01];
|
let mut algo_attributes = vec![0x01];
|
||||||
|
|
||||||
// Length of modulus n in bit
|
// 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
|
// Length of public exponent e in bit
|
||||||
algo_attributes.push(0x00);
|
algo_attributes.push(0x00);
|
||||||
|
|
|
@ -302,7 +302,7 @@ impl CardTransaction for PcscTransaction<'_> {
|
||||||
];
|
];
|
||||||
|
|
||||||
// 15 ulDataLength ULONG length of Data to be sent to the ICC
|
// 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
|
// 19 abData BYTE[] Data to send to the ICC
|
||||||
send.extend(ab_data);
|
send.extend(ab_data);
|
||||||
|
@ -405,7 +405,7 @@ impl CardTransaction for PcscTransaction<'_> {
|
||||||
];
|
];
|
||||||
|
|
||||||
// 15 ulDataLength ULONG length of Data to be sent to the ICC
|
// 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
|
// 19 abData BYTE[] Data to send to the ICC
|
||||||
send.extend(ab_data);
|
send.extend(ab_data);
|
||||||
|
|
|
@ -230,7 +230,8 @@ pub(crate) fn print_gnuk_note(err: Error, card: &Card<Transaction>) -> Result<()
|
||||||
) {
|
) {
|
||||||
// check if no keys exist on the card
|
// check if no keys exist on the card
|
||||||
let fps = card.fingerprints()?;
|
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!(
|
println!(
|
||||||
"\nNOTE: Some cards (e.g. Gnuk) don't allow \
|
"\nNOTE: Some cards (e.g. Gnuk) don't allow \
|
||||||
User PIN change while no keys exist on the card."
|
User PIN change while no keys exist on the card."
|
||||||
|
|
Loading…
Reference in a new issue