Fix most Clippy warnings.

This commit is contained in:
Guillaume Endignoux
2020-09-23 16:21:20 +02:00
parent 616476ac43
commit 5511811703
8 changed files with 16 additions and 5 deletions

View File

@@ -44,6 +44,7 @@ impl TockAllocator {
}
unsafe impl GlobalAlloc for TockAllocator {
#[allow(clippy::let_and_return)]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
let ptr = HEAP
.allocate_first_fit(layout)

View File

@@ -25,6 +25,7 @@ pub struct Console {
}
impl Console {
#[allow(clippy::new_without_default)]
pub fn new() -> Console {
Console {
allow_buffer: [0; BUFFER_SIZE],

View File

@@ -41,5 +41,5 @@ pub fn fill_buffer(buf: &mut [u8]) -> bool {
}
util::yieldk_for(|| is_filled.get());
return true;
true
}

View File

@@ -173,6 +173,7 @@ pub fn send_or_recv(buf: &mut [u8; 64]) -> SendOrRecvStatus {
// Same as recv, but with a timeout.
// If the timeout elapses, return None.
#[allow(clippy::let_and_return)]
pub fn recv_with_timeout(
buf: &mut [u8; 64],
timeout_delay: Duration<isize>,
@@ -199,6 +200,7 @@ pub fn recv_with_timeout(
// Same as send_or_recv, but with a timeout.
// If the timeout elapses, return None.
#[allow(clippy::let_and_return)]
pub fn send_or_recv_with_timeout(
buf: &mut [u8; 64],
timeout_delay: Duration<isize>,