Skip to content

Commit

Permalink
Update tokio
Browse files Browse the repository at this point in the history
  • Loading branch information
jD91mZM2 committed Mar 16, 2021
1 parent 92fecea commit d8d0d03
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 145 deletions.
169 changes: 38 additions & 131 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion xidlehook-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ log = "0.4.8"
nix = "0.15.0"
structopt = "0.3.5"
xcb = { version = "0.9.0", features = ["x11", "screensaver"] }
tokio = { version = "0.2.21", optional = true, features = ["time", "stream"] }
tokio = { version = "1.3.0", optional = true, features = ["time"] }

[dependencies.libpulse-binding]
optional = true
Expand Down
5 changes: 2 additions & 3 deletions xidlehook-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ where
async_std::task::sleep(delay).await;
#[cfg(feature = "tokio")]
if cfg!(not(feature = "async-std")) {
tokio::time::delay_for(delay).await;
tokio::time::sleep(delay).await;
}

if let Some(time_difference) = sleep_start.elapsed().checked_sub(delay) {
Expand All @@ -552,8 +552,7 @@ where
async_std::future::pending::<()>().await;
#[cfg(feature = "tokio")]
if cfg!(not(feature = "async-std")) {
use tokio::stream::StreamExt;
tokio::stream::pending::<()>().next().await;
std::future::pending::<()>().await;
}
},
Action::Quit => break,
Expand Down
2 changes: 1 addition & 1 deletion xidlehook-daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ serde_json = "1.0.42"
structopt = "0.3.5"
xcb = { version = "0.9.0", features = ["x11", "screensaver"] }
xidlehook-core = { version = "0.3.0", default-features = false, features = ["tokio"] }
tokio = { version = "0.2.21", features = ["io-util", "macros", "rt-core", "signal", "stream", "sync", "uds"] }
tokio = { version = "1.3.0", features = ["io-util", "macros", "signal", "sync", "net", "rt"] }

[features]
default = ["pulse"]
Expand Down
Loading

0 comments on commit d8d0d03

Please sign in to comment.