Skip to content

Commit a545edf

Browse files
committed
Changes from code review.
1 parent 74b3966 commit a545edf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/frame.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use spin::Mutex;
1212
/// A frame allocator that uses buddy system, requiring a global allocator.
1313
///
1414
/// The max order of the allocator is specified via the const generic parameter `ORDER`. The frame
15-
/// allocator will only be able to allocate ranges of size up to 2\*\*ORDER, out of a total range of
16-
/// size at most 2\*\*(ORDER + 1) - 1.
15+
/// allocator will only be able to allocate ranges of size up to 2<sup>ORDER</sup>, out of a total
16+
/// range of size at most 2<sup>ORDER + 1</sup> - 1.
1717
///
1818
/// # Usage
1919
///
@@ -41,7 +41,7 @@ pub struct FrameAllocator<const ORDER: usize = 32> {
4141
impl<const ORDER: usize> FrameAllocator<ORDER> {
4242
/// Create an empty frame allocator
4343
pub fn new() -> Self {
44-
FrameAllocator {
44+
Self {
4545
free_list: array::from_fn(|_| BTreeSet::default()),
4646
allocated: 0,
4747
total: 0,
@@ -157,7 +157,7 @@ pub struct LockedFrameAllocator<const ORDER: usize = 32>(Mutex<FrameAllocator<OR
157157
impl<const ORDER: usize> LockedFrameAllocator<ORDER> {
158158
/// Creates an empty heap
159159
pub fn new() -> Self {
160-
LockedFrameAllocator(Mutex::new(FrameAllocator::new()))
160+
Self(Mutex::new(FrameAllocator::new()))
161161
}
162162
}
163163

0 commit comments

Comments
 (0)