Skip to content

Commit

Permalink
perf(http): use optimized slice::to_vec() (#2298)
Browse files Browse the repository at this point in the history
The generated code is much smaller.
  • Loading branch information
nickelc authored Nov 25, 2023
1 parent 2d8b170 commit ad72604
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion twilight-http/src/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl Future for BytesFuture {

fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
if let Poll::Ready(result) = Pin::new(&mut self.inner).poll(cx) {
Poll::Ready(result.map(|b| b.into_iter().collect()))
Poll::Ready(result.map(|b| b.to_vec()))
} else {
Poll::Pending
}
Expand Down

0 comments on commit ad72604

Please sign in to comment.