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:
committed by
GitHub
parent
d226209ea4
commit
78313360a1
+1
-5
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user