From 2f8f689cfdd5662fe438ec03db4e2eb9078afb01 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 12 Jun 2025 12:41:28 -0700 Subject: [PATCH] Update `rustix` to 1.x We have both in the dependency tree now, so may as well update here. --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/utils.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ebfaa8..c8b5730 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1224,7 +1224,7 @@ dependencies = [ "log", "memmap2 0.9.5", "rust-embed", - "rustix 0.38.44", + "rustix 1.0.7", "tokio", "wayland-protocols", ] diff --git a/Cargo.toml b/Cargo.toml index e0e58f5..ed68435 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ itertools = "0.14.0" log = "0.4.20" i18n-embed-fl = "0.9.0" rust-embed = "8.1.0" -rustix = { version = "0.38.30", features = ["fs"] } +rustix = { version = "1.0.7", features = ["fs", "shm"] } calloop-wayland-source = "0.4.0" aliasable = "0.1.3" futures-executor = { version = "0.3.31", features = ["thread-pool"] } diff --git a/src/utils.rs b/src/utils.rs index 9e88854..9b03a2b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,4 @@ -use rustix::{io::Errno, shm::ShmOFlags}; +use rustix::{io::Errno, shm}; use std::{ os::fd::OwnedFd, time::{SystemTime, UNIX_EPOCH}, @@ -26,7 +26,7 @@ pub fn create_memfile() -> rustix::io::Result { } loop { - let flags = ShmOFlags::CREATE | ShmOFlags::EXCL | ShmOFlags::RDWR; + let flags = shm::OFlags::CREATE | shm::OFlags::EXCL | shm::OFlags::RDWR; let time = SystemTime::now(); let name = format!( @@ -34,8 +34,8 @@ pub fn create_memfile() -> rustix::io::Result { time.duration_since(UNIX_EPOCH).unwrap().subsec_nanos() ); - match rustix::shm::shm_open(&name, flags, 0o600.into()) { - Ok(fd) => match rustix::shm::shm_unlink(&name) { + match shm::open(&name, flags, 0o600.into()) { + Ok(fd) => match shm::unlink(&name) { Ok(_) => return Ok(fd), Err(errno) => { return Err(errno);