Skip to content

Commit db15c8e

Browse files
committed
Address clippy suggestions
1 parent 9d1e2a0 commit db15c8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use core::alloc::{GlobalAlloc, Layout};
1212
use core::cell::RefCell;
13-
use core::ptr::NonNull;
13+
use core::ptr::{self, NonNull};
1414

1515
use cortex_m::interrupt::Mutex;
1616
use linked_list_allocator::Heap;
@@ -47,7 +47,7 @@ impl CortexMHeap {
4747
/// - The size of the heap is `(end_addr as usize) - (start_addr as usize)`. The
4848
/// allocator won't use the byte at `end_addr`.
4949
///
50-
/// # Unsafety
50+
/// # Safety
5151
///
5252
/// Obey these or Bad Stuff will happen.
5353
///
@@ -78,7 +78,7 @@ unsafe impl GlobalAlloc for CortexMHeap {
7878
.borrow_mut()
7979
.allocate_first_fit(layout)
8080
.ok()
81-
.map_or(0 as *mut u8, |allocation| allocation.as_ptr())
81+
.map_or(ptr::null_mut(), |allocation| allocation.as_ptr())
8282
})
8383
}
8484

0 commit comments

Comments
 (0)