const perm check

pull/2/head
ondra05 2023-08-08 01:44:33 +02:00
parent 96d8013790
commit 25978fb1f7
No known key found for this signature in database
GPG Key ID: 0DA6D2BB2285E881
1 changed files with 3 additions and 3 deletions

View File

@ -479,7 +479,7 @@ pub mod perm_check {
/// Page is readable
#[inline(always)]
pub fn readable(perm: Permission) -> bool {
pub const fn readable(perm: Permission) -> bool {
matches!(
perm,
Permission::Readonly | Permission::Write | Permission::Exec
@ -488,7 +488,7 @@ pub mod perm_check {
/// Page is writable
#[inline(always)]
pub fn writable(perm: Permission) -> bool {
perm == Permission::Write
pub const fn writable(perm: Permission) -> bool {
matches!(perm, Permission::Write)
}
}