From b61fe07ed13657a03b3348ab4a05f8a5ec8ea95b Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Mon, 16 Sep 2024 14:42:27 -0400 Subject: [PATCH] heed clippy --- capnp-rpc/src/flow_control.rs | 8 ++++---- capnp-rpc/src/rpc.rs | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/capnp-rpc/src/flow_control.rs b/capnp-rpc/src/flow_control.rs index 36ca6f617..afbe3cbf7 100644 --- a/capnp-rpc/src/flow_control.rs +++ b/capnp-rpc/src/flow_control.rs @@ -127,19 +127,19 @@ impl crate::FlowController for FixedWindowFlowController { match inner.state { State::Running(ref mut blocked_sends) => { if is_ready { - return Promise::ok(()); + Promise::ok(()) } else { let (snd, rcv) = oneshot::channel(); blocked_sends.push(snd); - return Promise::from_future(async { + Promise::from_future(async { match rcv.await { Ok(r) => r, Err(e) => Err(crate::canceled_to_error(e)), } - }); + }) } } - State::Failed(ref e) => return Promise::err(e.clone()), + State::Failed(ref e) => Promise::err(e.clone()), } } diff --git a/capnp-rpc/src/rpc.rs b/capnp-rpc/src/rpc.rs index e94c065ef..b1751a278 100644 --- a/capnp-rpc/src/rpc.rs +++ b/capnp-rpc/src/rpc.rs @@ -1854,14 +1854,13 @@ where let Some(ref mut flow) = *flow else { unreachable!() }; - let flow_promise = flow.send( + flow.send( message, Promise::from_future(async move { let _ = promise.await?; Ok(()) }), - ); - flow_promise + ) } }