From ad7260461a7e532fcc522f823931d05143eb3029 Mon Sep 17 00:00:00 2001 From: nickelc Date: Sat, 25 Nov 2023 17:22:44 +0100 Subject: [PATCH] perf(http): use optimized `slice::to_vec()` (#2298) The generated code is much smaller. --- twilight-http/src/response/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilight-http/src/response/mod.rs b/twilight-http/src/response/mod.rs index 199af9dd545..48c9076c697 100644 --- a/twilight-http/src/response/mod.rs +++ b/twilight-http/src/response/mod.rs @@ -445,7 +445,7 @@ impl Future for BytesFuture { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { 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 }