Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #148

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rust-analyzer.showUnlinkedFileNotification": false
}
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
3 changes: 1 addition & 2 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -181,7 +180,7 @@
unsafe fn register(&self, dispatcher: &RefCell<IoDispatcher>) -> crate::Result<()> {
let disp = dispatcher.borrow();
self.poll.borrow_mut().register(
unsafe { BorrowedFd::borrow_raw(disp.fd) },

Check warning on line 183 in src/io.rs

View workflow job for this annotation

GitHub Actions / CI (1.63.0)

unnecessary `unsafe` block

Check warning on line 183 in src/io.rs

View workflow job for this annotation

GitHub Actions / CI (1.63.0)

unnecessary `unsafe` block
Interest::EMPTY,
Mode::OneShot,
disp.token.expect("No token for IO dispatcher"),
Expand Down
4 changes: 2 additions & 2 deletions src/loop_logic.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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};
Expand Down Expand Up @@ -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),
Expand Down
9 changes: 7 additions & 2 deletions src/sources/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion src/sources/ping/eventfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion src/sources/ping/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 2 additions & 8 deletions src/sys.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -336,7 +330,7 @@
let ev = cvt_interest(interest, token);

// SAFETY: See invariant on function.
unsafe {

Check warning on line 333 in src/sys.rs

View workflow job for this annotation

GitHub Actions / CI (1.63.0)

unnecessary `unsafe` block

Check warning on line 333 in src/sys.rs

View workflow job for this annotation

GitHub Actions / CI (1.63.0)

unnecessary `unsafe` block
self.poller
.add_with_mode(raw, ev, cvt_mode(mode, self.poller.supports_level()))?;
}
Expand Down
Loading