Fix most Clippy warnings.
This commit is contained in:
1
third_party/lang-items/src/allocator.rs
vendored
1
third_party/lang-items/src/allocator.rs
vendored
@@ -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)
|
||||
|
||||
1
third_party/libtock-drivers/src/console.rs
vendored
1
third_party/libtock-drivers/src/console.rs
vendored
@@ -25,6 +25,7 @@ pub struct Console {
|
||||
}
|
||||
|
||||
impl Console {
|
||||
#[allow(clippy::new_without_default)]
|
||||
pub fn new() -> Console {
|
||||
Console {
|
||||
allow_buffer: [0; BUFFER_SIZE],
|
||||
|
||||
2
third_party/libtock-drivers/src/rng.rs
vendored
2
third_party/libtock-drivers/src/rng.rs
vendored
@@ -41,5 +41,5 @@ pub fn fill_buffer(buf: &mut [u8]) -> bool {
|
||||
}
|
||||
|
||||
util::yieldk_for(|| is_filled.get());
|
||||
return true;
|
||||
true
|
||||
}
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user