Skip to content

Commit

Permalink
feat(proxy): remove lifetime from request future
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjentix committed Dec 17, 2024
1 parent b3392a3 commit 439ec81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions elfo-test/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ impl Proxy {

/// See [`Context::request()`] for details.
#[track_caller]
pub fn request<R: Request>(&self, request: R) -> impl Future<Output = R::Response> + '_ {
pub fn request<R: Request>(&self, request: R) -> impl Future<Output = R::Response> {
let location = Location::caller();
let context = self.context.pruned();
self.scope.clone().within(async move {
let name = request.name();
match self.context.request(request).resolve().await {
match context.request(request).resolve().await {
Ok(response) => response,
Err(err) => panic!("cannot send {} ({}) at {}", name, err, location),
}
Expand Down

0 comments on commit 439ec81

Please sign in to comment.