mirror of https://github.com/fafhrd91/actix-net
Remove 'static requirement from std::future::Future
This commit is contained in:
parent
6e78c3a467
commit
66a665826a
|
@ -24,7 +24,7 @@ mod executor_impl {
|
||||||
|
|
||||||
pub fn block_on_local<F>(rt: &mut Runtime, local: &LocalSet, f: F) -> F::Output
|
pub fn block_on_local<F>(rt: &mut Runtime, local: &LocalSet, f: F) -> F::Output
|
||||||
where
|
where
|
||||||
F: std::future::Future + 'static,
|
F: std::future::Future,
|
||||||
{
|
{
|
||||||
local.block_on(rt, f)
|
local.block_on(rt, f)
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ mod executor_impl {
|
||||||
|
|
||||||
pub fn block_on_local<F>(rt: &mut Runtime, local: &LocalSet, f: F) -> F::Output
|
pub fn block_on_local<F>(rt: &mut Runtime, local: &LocalSet, f: F) -> F::Output
|
||||||
where
|
where
|
||||||
F: std::future::Future + 'static,
|
F: std::future::Future,
|
||||||
{
|
{
|
||||||
rt.block_on_std(local.run_until(f))
|
rt.block_on_std(local.run_until(f))
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ impl System {
|
||||||
rest_operations: Fut,
|
rest_operations: Fut,
|
||||||
) -> R
|
) -> R
|
||||||
where
|
where
|
||||||
Fut: std::future::Future<Output = R> + 'static,
|
Fut: std::future::Future<Output = R>,
|
||||||
{
|
{
|
||||||
let actix_system_task = LocalSet::new();
|
let actix_system_task = LocalSet::new();
|
||||||
let sys = System::run_in_tokio(name.into(), &actix_system_task);
|
let sys = System::run_in_tokio(name.into(), &actix_system_task);
|
||||||
|
|
Loading…
Reference in New Issue