diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c404aba..7973658 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: os: [ubuntu-latest, windows-latest] # When updating this, the reminder to update the minimum supported # Rust version in Cargo.toml. - rust: ['1.63'] + rust: ['1.70'] steps: - uses: actions/checkout@v4 - name: Install Rust diff --git a/Cargo.toml b/Cargo.toml index 6e61ef6..362d00c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ name = "async-process" version = "2.4.0" authors = ["Stjepan Glavina "] edition = "2021" -rust-version = "1.63" +rust-version = "1.70" description = "Async interface for working with processes" license = "Apache-2.0 OR MIT" repository = "https://github.com/smol-rs/async-process" @@ -15,7 +15,6 @@ categories = ["asynchronous", "os"] exclude = ["/.*"] [dependencies] -async-lock = "3.0.0" async-io = "2.3.0" cfg-if = "1.0" event-listener = "5.1.0" @@ -23,6 +22,7 @@ futures-lite = "2.0.0" tracing = { version = "0.1.40", default-features = false, optional = true } [target.'cfg(unix)'.dependencies] +async-lock = "3.0.0" async-signal = "0.2.3" rustix = { version = "1.0", default-features = false, features = ["std", "fs", "process"] } diff --git a/src/lib.rs b/src/lib.rs index 6d5af70..d1b2fd7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,7 +62,7 @@ use std::fmt; use std::path::Path; use std::pin::Pin; use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::{Arc, Mutex}; +use std::sync::{Arc, Mutex, OnceLock}; use std::task::{Context, Poll}; use std::thread; @@ -74,7 +74,6 @@ use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, OwnedFd, RawFd}; #[cfg(windows)] use blocking::Unblock; -use async_lock::OnceCell; use futures_lite::{future, io, prelude::*}; #[doc(no_inline)] @@ -117,9 +116,9 @@ struct Reaper { impl Reaper { /// Get the singleton instance of the reaper. fn get() -> &'static Self { - static REAPER: OnceCell = OnceCell::new(); + static REAPER: OnceLock = OnceLock::new(); - REAPER.get_or_init_blocking(|| Reaper { + REAPER.get_or_init(|| Reaper { sys: reaper::Reaper::new(), drivers: AtomicUsize::new(0), child_count: AtomicUsize::new(0),