"#),
);
- macro_rules! content {
- {} => {
- itertools::chain![
- array::IntoIter::new([
- Ok::<Bytes,Void>( prefix1.into() ),
- Ok::<Bytes,Void>( prefix2.into() ),
- ]).take(
- if upbound.is_empty() { 1 } else { 2 }
- ),
- Itertools::intersperse(
- upbound.into_iter().map(|u| Bytes::from(u)),
- SLIP_END_SLICE.into()
- ).map(Ok::<Bytes,Void>),
- [ Ok::<Bytes,Void>( suffix.into() ) ],
- ]
- }
- }
+ macro_rules! content { {
+ $out:ty
+ } => {
+ itertools::chain![
+ array::IntoIter::new([
+ Ok::<$out,Void>( prefix1.into() ),
+ Ok::<$out,Void>( prefix2.into() ),
+ ]).take(
+ if upbound.is_empty() { 1 } else { 2 }
+ ),
+ Itertools::intersperse(
+ upbound.into_iter().map(|u| { let out: $out = u.into(); out }),
+ SLIP_END_SLICE.into()
+ ).map(Ok::<$out,Void>),
+ [ Ok::<$out,Void>( suffix.into() ) ],
+ ]
+ }}
let body = hyper::body::Body::wrap_stream(
futures::stream::iter(
- content!()
+ content!( Bytes )
)
);