Use empty() instead of NONE with rsix flags types.
`empty()` is provided by all `bitflags` types, so it's more idiomatic than having `NONE` values.
This commit is contained in:
@@ -14,7 +14,7 @@ fn decommit(addr: *mut u8, len: usize, protect: bool) -> Result<()> {
|
||||
addr as _,
|
||||
len,
|
||||
if protect {
|
||||
rsix::io::ProtFlags::NONE
|
||||
rsix::io::ProtFlags::empty()
|
||||
} else {
|
||||
rsix::io::ProtFlags::READ | rsix::io::ProtFlags::WRITE
|
||||
},
|
||||
|
||||
@@ -190,7 +190,7 @@ impl Mmap {
|
||||
rsix::io::mmap_anonymous(
|
||||
ptr::null_mut(),
|
||||
mapping_size,
|
||||
rsix::io::ProtFlags::NONE,
|
||||
rsix::io::ProtFlags::empty(),
|
||||
rsix::io::MapFlags::PRIVATE,
|
||||
)
|
||||
.context(format!("mmap failed to allocate {:#x} bytes", mapping_size))?
|
||||
|
||||
@@ -297,7 +297,7 @@ pub fn lazy_per_thread_init() -> Result<(), Box<Trap>> {
|
||||
let ptr = rsix::io::mmap_anonymous(
|
||||
null_mut(),
|
||||
alloc_size,
|
||||
rsix::io::ProtFlags::NONE,
|
||||
rsix::io::ProtFlags::empty(),
|
||||
rsix::io::MapFlags::PRIVATE,
|
||||
)
|
||||
.map_err(|_| Box::new(Trap::oom()))?;
|
||||
|
||||
Reference in New Issue
Block a user