mirror of
https://github.com/trussed-dev/ctaphid-dispatch.git
synced 2026-06-20 04:16:18 -07:00
Fix clippy lints
This commit is contained in:
+4
-5
@@ -127,11 +127,10 @@ impl TryFrom<u8> for VendorCommand {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(from: u8) -> core::result::Result<Self, ()> {
|
||||
match from {
|
||||
// code if code >= Self::FIRST && code <= Self::LAST => Ok(VendorCommand(code)),
|
||||
code @ Self::FIRST..=Self::LAST => Ok(unsafe { core::mem::transmute(code) }),
|
||||
// TODO: replace with Command::Unknown and infallible Try
|
||||
_ => Err(()),
|
||||
if (Self::FIRST..=Self::LAST).contains(&from) {
|
||||
Ok(unsafe { core::mem::transmute::<u8, VendorCommand>(from) })
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ pub struct Dispatch<'pipe, 'interrupt> {
|
||||
interrupt: Option<&'interrupt OptionRefSwap<'interrupt, InterruptFlag>>,
|
||||
}
|
||||
|
||||
impl<'pipe, 'interrupt> Dispatch<'pipe, 'interrupt> {
|
||||
impl<'pipe> Dispatch<'pipe, '_> {
|
||||
pub fn new(responder: Responder<'pipe>) -> Self {
|
||||
Dispatch {
|
||||
responder,
|
||||
|
||||
Reference in New Issue
Block a user