Fix new warnings

This commit is contained in:
Sosthène Guédon
2025-08-22 16:35:37 +02:00
parent 0a31e9cf7c
commit ed5bd863a2
2 changed files with 8 additions and 15 deletions
+1
View File
@@ -24,6 +24,7 @@ highspeed-usb = []
log-all = []
log-none = []
log-trace = []
log-info = []
log-debug = []
log-warn = []
+7 -15
View File
@@ -7,7 +7,6 @@ pub type ExtPacket = heapless::Vec<u8, MAX_MSG_LENGTH>;
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<Target = ExtPacket> {
#[inline]
fn slot(&self) -> u8 {
// we have only one slot
assert!(self[5] == 0);
self[5]
}
pub trait Packet: core::ops::Deref<Target = heapless::VecView<u8>> {
// #[inline]
// fn slot(&self) -> u8 {
// // we have only one slot
// assert!(self[5] == 0);
// self[5]
// }
#[inline]
fn seq(&self) -> u8 {