Skip to content

Commit 0cb87fe

Browse files
committed
constify PageTableIndex::new
1 parent 306422e commit 0cb87fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/structures/paging/page_table.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ pub struct PageTableIndex(u16);
296296
impl PageTableIndex {
297297
/// Creates a new index from the given `u16`. Panics if the given value is >=512.
298298
#[inline]
299-
pub fn new(index: u16) -> Self {
300-
assert!(usize::from(index) < ENTRY_COUNT);
299+
pub const fn new(index: u16) -> Self {
300+
assert!((index as usize) < ENTRY_COUNT);
301301
Self(index)
302302
}
303303

0 commit comments

Comments
 (0)