feat(lib): remove stream cargo feature (#2896)

Closes #2855
This commit is contained in:
Oddbjørn Grødem
2022-06-24 00:12:24 +02:00
committed by GitHub
parent a563404033
commit ce72f73464
14 changed files with 251 additions and 389 deletions

View File

@@ -6,7 +6,7 @@ extern crate test;
use bytes::Buf;
use futures_util::stream;
use futures_util::StreamExt;
use hyper::body::Body;
use http_body_util::StreamBody;
macro_rules! bench_stream {
($bencher:ident, bytes: $bytes:expr, count: $count:expr, $total_ident:ident, $body_pat:pat, $block:expr) => {{
@@ -20,9 +20,10 @@ macro_rules! bench_stream {
$bencher.iter(|| {
rt.block_on(async {
let $body_pat = Body::wrap_stream(
let $body_pat = StreamBody::new(
stream::iter(__s.iter()).map(|&s| Ok::<_, std::convert::Infallible>(s)),
);
$block;
});
});