forked from AbleOS/holey-bytes
const perm check
This commit is contained in:
parent
33c0499977
commit
2fb695b3a9
|
@ -479,7 +479,7 @@ pub mod perm_check {
|
||||||
|
|
||||||
/// Page is readable
|
/// Page is readable
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn readable(perm: Permission) -> bool {
|
pub const fn readable(perm: Permission) -> bool {
|
||||||
matches!(
|
matches!(
|
||||||
perm,
|
perm,
|
||||||
Permission::Readonly | Permission::Write | Permission::Exec
|
Permission::Readonly | Permission::Write | Permission::Exec
|
||||||
|
@ -488,7 +488,7 @@ pub mod perm_check {
|
||||||
|
|
||||||
/// Page is writable
|
/// Page is writable
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn writable(perm: Permission) -> bool {
|
pub const fn writable(perm: Permission) -> bool {
|
||||||
perm == Permission::Write
|
matches!(perm, Permission::Write)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue