Remove redundant `async move` blocks
@@ -317,20 +317,14 @@ where
let deps = Arc::new(deps);
- tokio::spawn(async move {
- ReceiverStream::new(rx)
- .for_each(|update| {
+ tokio::spawn(ReceiverStream::new(rx).for_each(move |update| {
let deps = Arc::clone(&deps);
let handler = Arc::clone(&handler);
let default_handler = Arc::clone(&default_handler);
let error_handler = Arc::clone(&error_handler);
- async move {
- handle_update(update, deps, handler, default_handler, error_handler).await;
- }
- })
- .await;
- });
+ handle_update(update, deps, handler, default_handler, error_handler)
+ }));
tx
}
@@ -348,20 +342,14 @@ where
let deps = Arc::new(deps);
- tokio::spawn(async move {
- ReceiverStream::new(rx)
- .for_each_concurrent(None, |update| {
+ tokio::spawn(ReceiverStream::new(rx).for_each_concurrent(None, move |update| {
let deps = Arc::clone(&deps);
let handler = Arc::clone(&handler);
let default_handler = Arc::clone(&default_handler);
let error_handler = Arc::clone(&error_handler);
- async move {
- handle_update(update, deps, handler, default_handler, error_handler).await;
- }
- })
- .await;
- });
+ handle_update(update, deps, handler, default_handler, error_handler)
+ }));
tx
}
