1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 15:42:57 +01:00

fix: relax bounds on with_tokio_rt (#569)

This commit is contained in:
Rob Ede 2024-06-09 07:12:24 +01:00 committed by GitHub
parent 0c26ecf9fa
commit 0d3d1926bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 3 deletions

View File

@ -4,6 +4,7 @@
## 2.10.0 ## 2.10.0
- Relax bound (`F: Fn -> FnOnce`) on `{Arbiter, System}::with_tokio_rt()` functions.
- Update `tokio-uring` dependency to `0.5`. - Update `tokio-uring` dependency to `0.5`.
- Minimum supported Rust version (MSRV) is now 1.70. - Minimum supported Rust version (MSRV) is now 1.70.

View File

@ -109,7 +109,7 @@ impl Arbiter {
#[cfg(not(all(target_os = "linux", feature = "io-uring")))] #[cfg(not(all(target_os = "linux", feature = "io-uring")))]
pub fn with_tokio_rt<F>(runtime_factory: F) -> Arbiter pub fn with_tokio_rt<F>(runtime_factory: F) -> Arbiter
where where
F: Fn() -> tokio::runtime::Runtime + Send + 'static, F: FnOnce() -> tokio::runtime::Runtime + Send + 'static,
{ {
let sys = System::current(); let sys = System::current();
let system_id = sys.id(); let system_id = sys.id();

View File

@ -48,7 +48,7 @@ impl System {
/// [tokio-runtime]: tokio::runtime::Runtime /// [tokio-runtime]: tokio::runtime::Runtime
pub fn with_tokio_rt<F>(runtime_factory: F) -> SystemRunner pub fn with_tokio_rt<F>(runtime_factory: F) -> SystemRunner
where where
F: Fn() -> tokio::runtime::Runtime, F: FnOnce() -> tokio::runtime::Runtime,
{ {
let (stop_tx, stop_rx) = oneshot::channel(); let (stop_tx, stop_rx) = oneshot::channel();
let (sys_tx, sys_rx) = mpsc::unbounded_channel(); let (sys_tx, sys_rx) = mpsc::unbounded_channel();
@ -87,7 +87,7 @@ impl System {
#[doc(hidden)] #[doc(hidden)]
pub fn with_tokio_rt<F>(_: F) -> SystemRunner pub fn with_tokio_rt<F>(_: F) -> SystemRunner
where where
F: Fn() -> tokio::runtime::Runtime, F: FnOnce() -> tokio::runtime::Runtime,
{ {
unimplemented!("System::with_tokio_rt is not implemented for io-uring feature yet") unimplemented!("System::with_tokio_rt is not implemented for io-uring feature yet")
} }

View File

@ -27,6 +27,10 @@ all_crate_features := if os() == "linux" {
"--features='" + non_linux_all_features_list + "'" "--features='" + non_linux_all_features_list + "'"
} }
# Run Clippy over workspace.
clippy toolchain="":
cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }}
# Test workspace code. # Test workspace code.
[macos, windows] [macos, windows]
test toolchain="": test toolchain="":