From ed5bd863a21e08e7f3656e17cd93dee4c5ab5e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Fri, 22 Aug 2025 16:35:37 +0200 Subject: [PATCH] Fix new warnings --- Cargo.toml | 1 + src/types/packet.rs | 22 +++++++--------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2cd6a2a..bb172f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ highspeed-usb = [] log-all = [] log-none = [] +log-trace = [] log-info = [] log-debug = [] log-warn = [] diff --git a/src/types/packet.rs b/src/types/packet.rs index c6e3491..4d24228 100644 --- a/src/types/packet.rs +++ b/src/types/packet.rs @@ -7,7 +7,6 @@ pub type ExtPacket = heapless::Vec; pub trait RawPacketExt { fn data_len(&self) -> usize; - fn zeroed() -> Self; fn zeroed_until(len: usize) -> Self; } @@ -16,13 +15,6 @@ impl RawPacketExt for RawPacket { u32::from_le_bytes(self[1..5].try_into().unwrap()) as usize } - fn zeroed() -> Self { - let mut res = Self::new(); - let cap = res.capacity(); - res.resize_default(cap).unwrap(); - res - } - fn zeroed_until(len: usize) -> Self { let mut res = Self::new(); let cap = res.capacity(); @@ -36,13 +28,13 @@ pub enum Error { UnknownCommand(u8), } -pub trait Packet: core::ops::Deref { - #[inline] - fn slot(&self) -> u8 { - // we have only one slot - assert!(self[5] == 0); - self[5] - } +pub trait Packet: core::ops::Deref> { + // #[inline] + // fn slot(&self) -> u8 { + // // we have only one slot + // assert!(self[5] == 0); + // self[5] + // } #[inline] fn seq(&self) -> u8 {