summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorChris West <solo-github@goeswhere.com>2018-10-17 16:59:21 +0100
committerdoug tangren <d.tangren@gmail.com>2018-10-17 11:59:21 -0400
commit75123f82a6f350299f1e9fc74d73dd4406a01cdc (patch)
tree67dfa8ef3471521f1db04426f3521d8958c04be7 /src/lib.rs
parent56cc6549012693d869e258f057df8163fab4843f (diff)
serde can't read a Vec<Value> from a stream (#126)
Fixes #123.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ba807a0..fd45911 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -181,7 +181,12 @@ impl<'a> Images<'a> {
self.docker
.stream_post(&path.join("?"), Some((Body::from(bytes), tar())))
- .and_then(|r| serde_json::from_reader::<_, Vec<Value>>(r).map_err(Error::from))
+ .and_then(|r| {
+ serde_json::Deserializer::from_reader(r)
+ .into_iter::<Value>()
+ .map(|res| res.map_err(Error::from))
+ .collect()
+ })
}
/// Lists the docker images on the current docker host
@@ -228,7 +233,12 @@ impl<'a> Images<'a> {
}
self.docker
.stream_post::<Body>(&path.join("?"), None)
- .and_then(|r| serde_json::from_reader::<_, Vec<Value>>(r).map_err(Error::from))
+ .and_then(|r| {
+ serde_json::Deserializer::from_reader(r)
+ .into_iter::<Value>()
+ .map(|res| res.map_err(Error::from))
+ .collect()
+ })
}
/// exports a collection of named images,