Add clippy::unwrap_used lint (#515)

Lints for usages of `unwrap()` in the `yubikey` crate (not CLI yet).

Replaces them with `?` or `expect()` as the situation warrants.
This commit is contained in:
Tony Arcieri (iqlusion)
2023-08-15 17:02:25 -07:00
committed by GitHub
parent d226209ea4
commit 78313360a1
11 changed files with 65 additions and 51 deletions
+1 -5
View File
@@ -96,11 +96,7 @@ impl<'tx> Transaction<'tx> {
return Err(Error::GenericError);
}
if response.data().len() < 3 {
return Err(Error::SizeError);
}
Ok(Version::new(response.data()[..3].try_into().unwrap()))
Ok(response.data()[..3].try_into().map(Version::new)?)
}
/// Get YubiKey device serial number.