Skip to content

Commit f147343

Browse files
committed
review: simplify RecordBodyData<S> response
Signed-off-by: katelyn martin <[email protected]>
1 parent 5a1a978 commit f147343

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

linkerd/http/prom/src/body_data/response.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,9 @@ where
8686

8787
let Self { inner, metrics } = self;
8888
let metrics = metrics.clone();
89-
let instrument = Box::new(|resp| Self::instrument_response(resp, metrics));
90-
91-
inner.call(req).map_ok(instrument).boxed()
92-
}
93-
}
94-
95-
impl<S> RecordBodyData<S> {
96-
fn instrument_response<B>(resp: Response<B>, metrics: BodyDataMetrics) -> Response<BoxBody>
97-
where
98-
B: Body + Send + 'static,
99-
B::Data: Send + 'static,
100-
B::Error: Into<Error>,
101-
{
102-
resp.map(|b| super::body::Body::new(b, metrics))
103-
.map(BoxBody::new)
89+
inner
90+
.call(req)
91+
.map_ok(|rsp| rsp.map(|b| BoxBody::new(super::body::Body::new(b, metrics))))
92+
.boxed()
10493
}
10594
}

0 commit comments

Comments
 (0)