Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed Oct 6, 2022
1 parent bf99a88 commit dc8d426
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iroh-rpc-types/src/connection_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ impl Service<tonic::codegen::http::Request<BoxBody>> for TonicConnectionPool {
}

fn call(&mut self, request: tonic::codegen::http::Request<BoxBody>) -> Self::Future {
let this = self.clone();
let this = self.inner.clone();
let inner = std::mem::replace(&mut self.inner, this);
// TODO: error handling
let fut = Box::pin(async move {
let conn = &mut *this.inner.get().await.unwrap();
Service::call(conn, request).await
let mut conn = inner.get().await.unwrap();
Service::call(&mut *conn, request).await
}); // TODO: avoid box

ResponseFuture { inner: fut }
Expand Down

0 comments on commit dc8d426

Please sign in to comment.