From 897f16a3a65dacd9a2d9f113659a443b5ade0cea Mon Sep 17 00:00:00 2001 From: Sergey Tsaplin Date: Fri, 31 May 2019 20:00:46 +0300 Subject: Fix build image response parsing error (#177) --- src/lib.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 687a0e0..4c324ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -146,11 +146,15 @@ impl<'a> Images<'a> { Some((Body::from(bytes), tar())), None::>, ) - .and_then(|bytes| { - serde_json::from_slice::<'_, Value>(&bytes[..]) - .map_err(Error::from) - .into_future() - }), + .map(|r| { + futures::stream::iter_result( + serde_json::Deserializer::from_slice(&r[..]) + .into_iter::() + .collect::>(), + ) + .map_err(Error::from) + }) + .flatten(), ) as Box + Send>, Err(e) => Box::new(futures::future::err(Error::IO(e)).into_stream()) as Box + Send>, -- cgit v1.2.3