1
0
Fork 0
forked from wry/wry

all: remove once_cell dependency

This commit is contained in:
Julian Orth 2026-03-30 12:30:26 +02:00
parent c50242562a
commit 41ef632a15
10 changed files with 34 additions and 32 deletions

View file

@ -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"),

View file

@ -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