mirror of
https://github.com/trussed-dev/usbd-ccid.git
synced 2026-06-20 04:16:20 -07:00
Fix new warnings
This commit is contained in:
@@ -24,6 +24,7 @@ highspeed-usb = []
|
||||
|
||||
log-all = []
|
||||
log-none = []
|
||||
log-trace = []
|
||||
log-info = []
|
||||
log-debug = []
|
||||
log-warn = []
|
||||
|
||||
+7
-15
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user