Skip to content

Commit

Permalink
refactor(http/retry): use Poll<T> mapping methods
Browse files Browse the repository at this point in the history
Signed-off-by: katelyn martin <[email protected]>
  • Loading branch information
cratelyn committed Jan 31, 2025
1 parent 4e791fe commit 6df5d85
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions linkerd/http/retry/src/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,16 @@ where
if let Some(rest) = state.rest.as_mut() {
// If the inner body has previously ended, don't poll it again.
if !rest.is_end_stream() {
let res = futures::ready!(Pin::new(rest).poll_trailers(cx)).map(|tlrs| {
if state.trailers.is_none() {
state.trailers.clone_from(&tlrs);
}
tlrs
});
return Poll::Ready(res.map_err(Into::into));
return Pin::new(rest)
.poll_trailers(cx)
.map_ok(|tlrs| {
// Record a copy of the inner body's trailers in the shared state.
if state.trailers.is_none() {
state.trailers.clone_from(&tlrs);
}
tlrs
})
.map_err(Into::into);
}
}

Expand Down

0 comments on commit 6df5d85

Please sign in to comment.