Skip to content

Commit

Permalink
heed clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Sep 16, 2024
1 parent 68c6b8c commit b61fe07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions capnp-rpc/src/flow_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}

Expand Down
5 changes: 2 additions & 3 deletions capnp-rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}

Expand Down

0 comments on commit b61fe07

Please sign in to comment.