Skip to content

Commit c38d785

Browse files
author
daniel.eades
committed
remove redundant closures
1 parent 243edc3 commit c38d785

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

capnp-rpc/src/rpc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,9 +967,7 @@ impl<VatId> ConnectionState<VatId> {
967967
let (redirected_results_done_promise, redirected_results_done_fulfiller) =
968968
if redirect_results {
969969
let (f, p) = oneshot::channel::<Result<Response<VatId>, Error>>();
970-
let p = p
971-
.map_err(crate::canceled_to_error)
972-
.and_then(|x| future::ready(x));
970+
let p = p.map_err(crate::canceled_to_error).and_then(future::ready);
973971
(Some(Promise::from_future(p)), Some(f))
974972
} else {
975973
(None, None)
@@ -2773,7 +2771,7 @@ impl<VatId> PromiseClient<VatId> {
27732771
let (fulfiller, promise) = oneshot::channel::<Result<(), Error>>();
27742772
let promise = promise
27752773
.map_err(crate::canceled_to_error)
2776-
.and_then(|v| future::ready(v));
2774+
.and_then(future::ready);
27772775
let embargo = Embargo::new(fulfiller);
27782776
let embargo_id = connection_state.embargoes.borrow_mut().push(embargo);
27792777

0 commit comments

Comments
 (0)