Skip to content

Commit 6778b0d

Browse files
committed
drop once_cell dependency
1 parent 593b860 commit 6778b0d

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

.github/workflows/build-and-test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest, windows-latest, macos-latest]
16-
rust: [nightly, beta, stable, 1.60.0]
16+
rust: [nightly, beta, stable, 1.70.0]
1717
steps:
1818
- uses: actions/checkout@v2
1919

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ documentation = "https://docs.rs/async-global-executor"
1111
keywords = ["async", "await", "future", "executor"]
1212
categories = ["asynchronous", "concurrency"]
1313
readme = "README.md"
14-
rust-version = "1.60"
14+
rust-version = "1.70"
1515

1616
[features]
1717
default = ["async-io"]
@@ -23,7 +23,6 @@ async-channel = "^2.1.1"
2323
async-lock = "^3.2"
2424
blocking = "^1.5"
2525
futures-lite = "^2.0"
26-
once_cell = "^1.4"
2726

2827
[dependencies.async-executor]
2928
version = "^1.12"

src/config.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use once_cell::sync::OnceCell;
21
use std::{
32
fmt,
4-
sync::atomic::{AtomicUsize, Ordering},
3+
sync::{atomic::{AtomicUsize, Ordering}, OnceLock},
54
};
65

7-
pub(crate) static GLOBAL_EXECUTOR_CONFIG: OnceCell<Config> = OnceCell::new();
6+
pub(crate) static GLOBAL_EXECUTOR_CONFIG: OnceLock<Config> = OnceLock::new();
87

98
/// Configuration to init the thread pool for the multi-threaded global executor.
109
#[derive(Default)]

src/threading.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use crate::Task;
22
use async_channel::{Receiver, Sender};
33
use async_lock::Mutex;
44
use futures_lite::future;
5-
use once_cell::sync::OnceCell;
6-
use std::{io, thread};
5+
use std::{cell::OnceCell, io, thread};
76

87
// The current number of threads (some might be shutting down and not in the pool anymore)
98
static GLOBAL_EXECUTOR_THREADS_NUMBER: Mutex<usize> = Mutex::new(0);

src/tokio.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use once_cell::sync::Lazy;
1+
use std::sync::LazyLock;
22

33
pub(crate) fn enter() -> tokio::runtime::EnterGuard<'static> {
44
RUNTIME.enter()
55
}
66

7-
static RUNTIME: Lazy<tokio::runtime::Handle> = Lazy::new(|| {
7+
static RUNTIME: LazyLock<tokio::runtime::Handle> = LazyLock::new(|| {
88
tokio::runtime::Handle::try_current().unwrap_or_else(|_| {
99
let rt = tokio::runtime::Runtime::new().expect("failed to build tokio runtime");
1010
let handle = rt.handle().clone();

0 commit comments

Comments
 (0)