examples/futures: Use future::pending() instead of future::empty()

It was renamed in the last release.
This commit is contained in:
Sebastian Dröge 2019-07-06 09:56:34 +03:00
parent dda55616dd
commit 0bfa8fdcce

View file

@ -37,7 +37,8 @@ fn example_main() {
// We use an AbortHandle for having a Future that runs forever // We use an AbortHandle for having a Future that runs forever
// until we call handle.abort() to quit our event loop // until we call handle.abort() to quit our event loop
let (quit_handle, quit_registration) = future::AbortHandle::new_pair(); let (quit_handle, quit_registration) = future::AbortHandle::new_pair();
let quit_future = future::Abortable::new(future::empty::<()>(), quit_registration).map(|_| ()); let quit_future =
future::Abortable::new(future::pending::<()>(), quit_registration).map(|_| ());
// BusStream implements the Stream trait. Stream::for_each is calling a closure for each item // BusStream implements the Stream trait. Stream::for_each is calling a closure for each item
// and returns a Future that resolves when the stream is done // and returns a Future that resolves when the stream is done