Fix clippy lints

This commit is contained in:
Robin Krahl
2025-01-02 22:43:14 +01:00
parent 2b1aa2c0da
commit 910c207994
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -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
View File
@@ -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,