Skip to content

Commit

Permalink
fix: relax bounds on with_tokio_rt (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede authored Jun 9, 2024
1 parent 0c26ecf commit 0d3d192
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions actix-rt/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion actix-rt/src/arbiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl Arbiter {
#[cfg(not(all(target_os = "linux", feature = "io-uring")))]
pub fn with_tokio_rt<F>(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();
Expand Down
4 changes: 2 additions & 2 deletions actix-rt/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl System {
/// [tokio-runtime]: tokio::runtime::Runtime
pub fn with_tokio_rt<F>(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();
Expand Down Expand Up @@ -87,7 +87,7 @@ impl System {
#[doc(hidden)]
pub fn with_tokio_rt<F>(_: 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")
}
Expand Down
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="":
Expand Down

0 comments on commit 0d3d192

Please sign in to comment.