diff --git a/actix-rt/CHANGES.md b/actix-rt/CHANGES.md index 05bc8e36..98841887 100644 --- a/actix-rt/CHANGES.md +++ b/actix-rt/CHANGES.md @@ -4,6 +4,7 @@ ## 2.10.0 +- Relax bound (`F: Fn -> FnOnce`) on `{Arbiter, System}::with_tokio_rt()` functions. - Update `tokio-uring` dependency to `0.5`. - Minimum supported Rust version (MSRV) is now 1.70. diff --git a/actix-rt/src/arbiter.rs b/actix-rt/src/arbiter.rs index ee647aef..1da76c52 100644 --- a/actix-rt/src/arbiter.rs +++ b/actix-rt/src/arbiter.rs @@ -109,7 +109,7 @@ impl Arbiter { #[cfg(not(all(target_os = "linux", feature = "io-uring")))] pub fn with_tokio_rt(runtime_factory: F) -> Arbiter where - F: Fn() -> tokio::runtime::Runtime + Send + 'static, + F: FnOnce() -> tokio::runtime::Runtime + Send + 'static, { let sys = System::current(); let system_id = sys.id(); diff --git a/actix-rt/src/system.rs b/actix-rt/src/system.rs index 367a2d21..f9fe4c8d 100644 --- a/actix-rt/src/system.rs +++ b/actix-rt/src/system.rs @@ -48,7 +48,7 @@ impl System { /// [tokio-runtime]: tokio::runtime::Runtime pub fn with_tokio_rt(runtime_factory: F) -> SystemRunner where - F: Fn() -> tokio::runtime::Runtime, + F: FnOnce() -> tokio::runtime::Runtime, { let (stop_tx, stop_rx) = oneshot::channel(); let (sys_tx, sys_rx) = mpsc::unbounded_channel(); @@ -87,7 +87,7 @@ impl System { #[doc(hidden)] pub fn with_tokio_rt(_: F) -> SystemRunner where - F: Fn() -> tokio::runtime::Runtime, + F: FnOnce() -> tokio::runtime::Runtime, { unimplemented!("System::with_tokio_rt is not implemented for io-uring feature yet") } diff --git a/justfile b/justfile index ae80165b..e7a7978a 100644 --- a/justfile +++ b/justfile @@ -27,6 +27,10 @@ all_crate_features := if os() == "linux" { "--features='" + non_linux_all_features_list + "'" } +# Run Clippy over workspace. +clippy toolchain="": + cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }} + # Test workspace code. [macos, windows] test toolchain="":