Skip to content

Commit

Permalink
constify PageTableIndex::new
Browse files Browse the repository at this point in the history
  • Loading branch information
Freax13 committed Mar 2, 2024
1 parent 306422e commit 0cb87fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structures/paging/page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ pub struct PageTableIndex(u16);
impl PageTableIndex {
/// Creates a new index from the given `u16`. Panics if the given value is >=512.
#[inline]
pub fn new(index: u16) -> Self {
assert!(usize::from(index) < ENTRY_COUNT);
pub const fn new(index: u16) -> Self {
assert!((index as usize) < ENTRY_COUNT);
Self(index)
}

Expand Down

0 comments on commit 0cb87fe

Please sign in to comment.