From b45a69699aa002e3afd764c3900d52f112855362 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Tue, 5 Dec 2017 10:02:49 +0900 Subject: [PATCH] Add a test for #2157 --- tests/source/chains.rs | 8 ++++++++ tests/target/chains.rs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/source/chains.rs b/tests/source/chains.rs index 0141326269b..0977212ef21 100644 --- a/tests/source/chains.rs +++ b/tests/source/chains.rs @@ -53,6 +53,14 @@ fn main() { .map(|x| x / 2) .fold(0, |acc, x| acc + x); + body.fold(Body::new(), |mut body, chunk| { + body.extend(chunk); + Ok(body) + }).and_then(move |body| { + let req = Request::from_parts(parts, body); + f(req).map_err(|_| io::Error::new(io::ErrorKind::Other, "")) + }); + aaaaaaaaaaaaaaaa.map(|x| { x += 1; x diff --git a/tests/target/chains.rs b/tests/target/chains.rs index 61ba04347e0..6e1fc809764 100644 --- a/tests/target/chains.rs +++ b/tests/target/chains.rs @@ -54,6 +54,14 @@ fn main() { let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum = xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(0, |acc, x| acc + x); + body.fold(Body::new(), |mut body, chunk| { + body.extend(chunk); + Ok(body) + }).and_then(move |body| { + let req = Request::from_parts(parts, body); + f(req).map_err(|_| io::Error::new(io::ErrorKind::Other, "")) + }); + aaaaaaaaaaaaaaaa .map(|x| { x += 1; -- 2.44.0