mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix more rustc warnings
This commit is contained in:
parent
53c4485387
commit
54648161ab
5 changed files with 6 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ impl<S: Storage> Linear<S> {
|
||||||
///
|
///
|
||||||
/// This function may allocate if the slice spans multiple pages (because they may not be
|
/// This function may allocate if the slice spans multiple pages (because they may not be
|
||||||
/// contiguous). However, a slice is returned if the range fits within a page.
|
/// contiguous). However, a slice is returned if the range fits within a page.
|
||||||
pub fn read(&self, range: Range<usize>) -> StorageResult<Cow<[u8]>> {
|
pub fn read(&self, range: Range<usize>) -> StorageResult<Cow<'_, [u8]>> {
|
||||||
if range.is_empty() {
|
if range.is_empty() {
|
||||||
return Ok(Cow::Borrowed(&[]));
|
return Ok(Cow::Borrowed(&[]));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ pub trait Storage {
|
||||||
///
|
///
|
||||||
/// Note that we use `Cow` just because it derefs to `[u8]`. We don't really need the fact that
|
/// Note that we use `Cow` just because it derefs to `[u8]`. We don't really need the fact that
|
||||||
/// one can convert it to a `Vec`. In particular we don't do it in the store implementation.
|
/// one can convert it to a `Vec`. In particular we don't do it in the store implementation.
|
||||||
fn read_slice(&self, index: StorageIndex, length: usize) -> StorageResult<Cow<[u8]>>;
|
fn read_slice(&self, index: StorageIndex, length: usize) -> StorageResult<Cow<'_, [u8]>>;
|
||||||
|
|
||||||
/// Writes a word slice to the storage.
|
/// Writes a word slice to the storage.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ impl CtapHid {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Helper function to parse a raw packet.
|
/// Helper function to parse a raw packet.
|
||||||
pub fn process_single_packet(packet: &HidPacket) -> (ChannelID, ProcessedPacket) {
|
pub fn process_single_packet(packet: &HidPacket) -> (ChannelID, ProcessedPacket<'_>) {
|
||||||
let (&cid, rest) = array_refs![packet, 4, 60];
|
let (&cid, rest) = array_refs![packet, 4, 60];
|
||||||
if rest[0] & CtapHid::PACKET_TYPE_MASK != 0 {
|
if rest[0] & CtapHid::PACKET_TYPE_MASK != 0 {
|
||||||
let cmd = rest[0] & !CtapHid::PACKET_TYPE_MASK;
|
let cmd = rest[0] & !CtapHid::PACKET_TYPE_MASK;
|
||||||
|
|
|
||||||
2
apps/vault/src/env/xous/storage.rs
vendored
2
apps/vault/src/env/xous/storage.rs
vendored
|
|
@ -48,7 +48,7 @@ impl Storage for XousStorage {
|
||||||
100_000
|
100_000
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_slice(&self, _index: StorageIndex, _length: usize) -> StorageResult<Cow<[u8]>> {
|
fn read_slice(&self, _index: StorageIndex, _length: usize) -> StorageResult<Cow<'_, [u8]>> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
use utralib::generated::*;
|
use utralib::generated::*;
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct Uart {
|
pub struct Uart {
|
||||||
// pub base: *mut u32,
|
// pub base: *mut u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Uart {
|
impl Uart {
|
||||||
#[cfg(any(feature = "precursor", feature = "renode"))]
|
#[cfg(any(feature = "precursor", feature = "renode"))]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn putc(&self, c: u8) {
|
pub fn putc(&self, c: u8) {
|
||||||
let base = utra::uart::HW_UART_BASE as *mut u32;
|
let base = utra::uart::HW_UART_BASE as *mut u32;
|
||||||
let mut uart = CSR::new(base);
|
let mut uart = CSR::new(base);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue