]> git.lizzy.rs Git - rust.git/commitdiff
Add a test for #2157
authorSeiichi Uchida <seuchida@gmail.com>
Tue, 5 Dec 2017 01:02:49 +0000 (10:02 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Tue, 5 Dec 2017 01:02:49 +0000 (10:02 +0900)
tests/source/chains.rs
tests/target/chains.rs

index 0141326269ba75fd3cb7702d395fa2030f729203..0977212ef218df1e150cf1b158667144aa50a624 100644 (file)
@@ -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
index 61ba04347e0d6dae9fe3adfc97a3c1fcda28a37c..6e1fc809764a5414dfd4df6321011a8ec6e4089a 100644 (file)
@@ -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;