From 7924f7289ce3cb9bc3a87f9d9185c62be87832ef Mon Sep 17 00:00:00 2001 From: Elinor Berger Date: Mon, 11 Sep 2023 14:49:06 +0200 Subject: [PATCH] Update dependencies --- .vscode/settings.json | 3 +++ Cargo.toml | 3 +-- src/io.rs | 3 +-- src/loop_logic.rs | 4 ++-- src/sources/generic.rs | 9 +++++++-- src/sources/ping/eventfd.rs | 2 +- src/sources/ping/pipe.rs | 2 +- src/sys.rs | 10 ++-------- 8 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..4d9636b5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "rust-analyzer.showUnlinkedFileNotification": false +} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index d859094e..3c3c7bc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,9 +20,8 @@ codecov = { repository = "Smithay/calloop" } [dependencies] async-task = { version = "4.4.0", optional = true } -bitflags = "1.2" +bitflags = "2.4" futures-io = { version = "0.3.5", optional = true } -io-lifetimes = "1.0.3" log = "0.4" nix = { version = "0.26", default-features = false, features = ["signal"], optional = true } pin-utils = { version = "0.1.0", optional = true } diff --git a/src/io.rs b/src/io.rs index 321dc661..0cc8c5d5 100644 --- a/src/io.rs +++ b/src/io.rs @@ -7,12 +7,11 @@ //! [`LoopHandle::adapt_io`]: crate::LoopHandle#method.adapt_io use std::cell::RefCell; -use std::os::unix::io::{AsRawFd, RawFd}; +use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, RawFd}; use std::pin::Pin; use std::rc::Rc; use std::task::{Context, Poll as TaskPoll, Waker}; -use io_lifetimes::{AsFd, BorrowedFd}; use rustix::fs::{fcntl_getfl, fcntl_setfl, OFlags}; #[cfg(feature = "futures-io")] diff --git a/src/loop_logic.rs b/src/loop_logic.rs index 508cc027..2de60260 100644 --- a/src/loop_logic.rs +++ b/src/loop_logic.rs @@ -1,5 +1,6 @@ use std::cell::{Cell, RefCell}; use std::fmt::Debug; +use std::os::unix::io::AsFd; use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; @@ -9,7 +10,6 @@ use std::{io, slice}; #[cfg(feature = "block_on")] use std::future::Future; -use io_lifetimes::AsFd; use slab::Slab; use crate::sources::{Dispatcher, EventSource, Idle, IdleDispatcher}; @@ -1050,7 +1050,7 @@ mod tests { use std::os::unix::io::FromRawFd; let event_loop = EventLoop::<()>::try_new().unwrap(); - let fd = unsafe { io_lifetimes::OwnedFd::from_raw_fd(420) }; + let fd = unsafe { std::os::unix::io::OwnedFd::from_raw_fd(420) }; let ret = event_loop.handle().insert_source( crate::sources::generic::Generic::new(fd, Interest::READ, Mode::Level), |_, _, _| Ok(PostAction::Continue), diff --git a/src/sources/generic.rs b/src/sources/generic.rs index b47d4778..45ed95ee 100644 --- a/src/sources/generic.rs +++ b/src/sources/generic.rs @@ -37,9 +37,14 @@ //! these `Generic<_>` as fields of your event source, and delegate the //! [`EventSource`](crate::EventSource) implementation to them. -use io_lifetimes::{AsFd, BorrowedFd}; use polling::Poller; -use std::{borrow, marker::PhantomData, ops, os::unix::io::AsRawFd, sync::Arc}; +use std::{ + borrow, + marker::PhantomData, + ops, + os::unix::io::{AsFd, AsRawFd, BorrowedFd}, + sync::Arc, +}; use crate::{EventSource, Interest, Mode, Poll, PostAction, Readiness, Token, TokenFactory}; diff --git a/src/sources/ping/eventfd.rs b/src/sources/ping/eventfd.rs index b28d3a3e..af39d31a 100644 --- a/src/sources/ping/eventfd.rs +++ b/src/sources/ping/eventfd.rs @@ -18,9 +18,9 @@ //! can then check the LSB and if it's set, we know it was a close event. This //! only works if a close event never fires more than once. +use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd}; use std::sync::Arc; -use io_lifetimes::{AsFd, BorrowedFd, OwnedFd}; use rustix::event::{eventfd, EventfdFlags}; use rustix::io::{read, write, Errno}; diff --git a/src/sources/ping/pipe.rs b/src/sources/ping/pipe.rs index d6ba959d..21591c2d 100644 --- a/src/sources/ping/pipe.rs +++ b/src/sources/ping/pipe.rs @@ -2,9 +2,9 @@ //! syscall. Sending a ping involves writing to one end of a pipe, and the other //! end becoming readable is what wakes up the event loop. +use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd}; use std::sync::Arc; -use io_lifetimes::{AsFd, BorrowedFd, OwnedFd}; use rustix::io::{read, write, Errno}; use super::PingError; diff --git a/src/sys.rs b/src/sys.rs index 363bad69..bc8350ca 100644 --- a/src/sys.rs +++ b/src/sys.rs @@ -1,16 +1,10 @@ use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc, time::Duration}; #[cfg(unix)] -use std::os::unix::io::{AsRawFd, BorrowedFd as Borrowed, RawFd as Raw}; +use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd as Borrowed, RawFd as Raw}; #[cfg(windows)] -use std::os::windows::io::{AsRawSocket, BorrowedSocket as Borrowed, RawSocket as Raw}; - -#[cfg(unix)] -use io_lifetimes::AsFd; - -#[cfg(windows)] -use io_lifetimes::AsSocket; +use std::os::windows::io::{AsRawSocket, AsSocket, BorrowedSocket as Borrowed, RawSocket as Raw}; use polling::{Event, Events, PollMode, Poller};