1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-07-03 10:46:40 +02:00

prepare rt release

This commit is contained in:
Nikolay Kim
2019-06-22 09:02:17 +06:00
parent 1c04ad3238
commit 07708c5e9a
4 changed files with 17 additions and 7 deletions

View File

@ -159,11 +159,11 @@ pub(crate) struct AsyncSystemRunner {
impl AsyncSystemRunner {
/// This function will start event loop and returns a future that
/// resolves once the `System::stop()` function is called.
pub(crate) fn run_nonblocking(self) -> Box<Future<Item = (), Error = io::Error> + Send + 'static> {
pub(crate) fn run_nonblocking(self) -> impl Future<Item = (), Error = io::Error> + Send {
let AsyncSystemRunner { stop, .. } = self;
// run loop
Box::new(future::lazy(|| {
future::lazy(|| {
Arbiter::run_system();
stop.then(|res| match res {
Ok(code) => {
@ -182,7 +182,7 @@ impl AsyncSystemRunner {
Arbiter::stop_system();
result
})
}))
})
}
}