Skip to content

Commit ba60228

Browse files
build(deps): update rustix requirement from 0.38.19 to 1.0.1 (#263)
Co-authored-by: Mads Marquart <[email protected]>
1 parent 438a8cc commit ba60228

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Diff for: Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bytemuck = { version = "1.12.3", optional = true }
5454
drm = { version = "0.14.1", default-features = false, optional = true }
5555
fastrand = { version = "2.0.0", optional = true }
5656
memmap2 = { version = "0.9.0", optional = true }
57-
rustix = { version = "0.38.19", features = [
57+
rustix = { version = "1.0.1", features = [
5858
"fs",
5959
"mm",
6060
"shm",
@@ -159,7 +159,7 @@ rayon = "1.5.1"
159159
wasm-bindgen-test = "0.3"
160160

161161
[target.'cfg(all(unix, not(any(target_vendor = "apple", target_os = "android", target_os = "redox"))))'.dev-dependencies]
162-
rustix = { version = "0.38.8", features = ["event"] }
162+
rustix = { version = "1.0.1", features = ["event"] }
163163

164164
[workspace]
165165
members = ["run-wasm"]

Diff for: examples/drm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ mod imple {
126126
&device,
127127
rustix::event::PollFlags::IN,
128128
)],
129-
-1,
129+
None,
130130
)?;
131131

132132
// Receive the events.
@@ -158,7 +158,7 @@ mod imple {
158158
}
159159

160160
let color = scale.eval_continuous(i);
161-
let pixel = (color.r as u32) << 16 | (color.g as u32) << 8 | (color.b as u32);
161+
let pixel = ((color.r as u32) << 16) | ((color.g as u32) << 8) | (color.b as u32);
162162
buf.fill(pixel);
163163
}
164164

Diff for: src/backends/wayland/buffer.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn create_memfile() -> File {
3030

3131
#[cfg(not(any(target_os = "linux", target_os = "freebsd")))]
3232
fn create_memfile() -> File {
33-
use rustix::{fs::Mode, io::Errno, shm::ShmOFlags};
33+
use rustix::{fs::Mode, io::Errno, shm::OFlags};
3434
use std::iter;
3535

3636
// Use a cached RNG to avoid hammering the thread local.
@@ -43,14 +43,14 @@ fn create_memfile() -> File {
4343

4444
let name = unsafe { CStr::from_bytes_with_nul_unchecked(name.as_bytes()) };
4545
// `CLOEXEC` is implied with `shm_open`
46-
let fd = rustix::shm::shm_open(
46+
let fd = rustix::shm::open(
4747
name,
48-
ShmOFlags::RDWR | ShmOFlags::CREATE | ShmOFlags::EXCL,
48+
OFlags::RDWR | OFlags::CREATE | OFlags::EXCL,
4949
Mode::RWXU,
5050
);
5151
if !matches!(fd, Err(Errno::EXIST)) {
5252
let fd = fd.expect("Failed to create POSIX shm to store buffer.");
53-
let _ = rustix::shm::shm_unlink(name);
53+
let _ = rustix::shm::unlink(name);
5454
return File::from(fd);
5555
}
5656
}

Diff for: src/backends/x11.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ impl<D: ?Sized, W: ?Sized> Drop for X11Impl<D, W> {
810810

811811
/// Create a shared memory identifier.
812812
fn create_shm_id() -> io::Result<OwnedFd> {
813-
use posix_shm::{Mode, ShmOFlags};
813+
use posix_shm::{Mode, OFlags};
814814

815815
let mut rng = fastrand::Rng::new();
816816
let mut name = String::with_capacity(23);
@@ -823,13 +823,13 @@ fn create_shm_id() -> io::Result<OwnedFd> {
823823
name.extend(std::iter::repeat_with(|| rng.alphanumeric()).take(7));
824824

825825
// Try to create the shared memory segment.
826-
match posix_shm::shm_open(
826+
match posix_shm::open(
827827
&name,
828-
ShmOFlags::RDWR | ShmOFlags::CREATE | ShmOFlags::EXCL,
828+
OFlags::RDWR | OFlags::CREATE | OFlags::EXCL,
829829
Mode::RWXU,
830830
) {
831831
Ok(id) => {
832-
posix_shm::shm_unlink(&name).ok();
832+
posix_shm::unlink(&name).ok();
833833
return Ok(id);
834834
}
835835

0 commit comments

Comments
 (0)