all: remove once_cell dependency
This commit is contained in:
parent
c50242562a
commit
41ef632a15
10 changed files with 34 additions and 32 deletions
|
|
@ -1,8 +1,8 @@
|
|||
use {
|
||||
once_cell::sync::Lazy,
|
||||
std::{
|
||||
error::Error,
|
||||
fmt::{Display, Formatter},
|
||||
sync::LazyLock,
|
||||
},
|
||||
uapi::{
|
||||
Errno,
|
||||
|
|
@ -10,7 +10,7 @@ use {
|
|||
},
|
||||
};
|
||||
|
||||
static ERRORS: Lazy<&'static [Option<&'static str>]> = Lazy::new(|| {
|
||||
static ERRORS: LazyLock<&'static [Option<&'static str>]> = LazyLock::new(|| {
|
||||
static MSGS: &[(c::c_int, &str)] = &[
|
||||
(c::EWOULDBLOCK, "Operation would block"),
|
||||
(c::ENOTSUP, "Not supported"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use {once_cell::sync::Lazy, uapi::c};
|
||||
use {std::sync::LazyLock, uapi::c};
|
||||
|
||||
static PAGE_SIZE: Lazy<usize> = Lazy::new(|| uapi::sysconf(c::_SC_PAGESIZE).unwrap_or(4096) as _);
|
||||
static PAGE_SIZE: LazyLock<usize> =
|
||||
LazyLock::new(|| uapi::sysconf(c::_SC_PAGESIZE).unwrap_or(4096) as _);
|
||||
|
||||
pub fn page_size() -> usize {
|
||||
*PAGE_SIZE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue