summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorsoftprops <d.tangren@gmail.com>2016-01-03 19:27:51 -0500
committersoftprops <d.tangren@gmail.com>2016-01-03 19:27:51 -0500
commit58b0f0a1831622ba5d69a1ab2ce562580a0c80ab (patch)
treed15c2acfd0ce7d3f236c0dd9bce9678e04a345fc /src/lib.rs
parentdf827431603ae817faaf1c6bc5fbf2a003302865 (diff)
rustfmt
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 96e3c3f..d245afd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,7 +26,8 @@ pub mod transport;
pub mod errors;
pub use errors::Error;
-pub use builder::{ContainerListOptions, ContainerFilter, EventsOptions, ImageFilter, ImageListOptions, LogsOptions};
+pub use builder::{ContainerListOptions, ContainerFilter, EventsOptions, ImageFilter,
+ ImageListOptions, LogsOptions};
// fixme: remove this here
use builder::ContainerBuilder;
@@ -37,8 +38,8 @@ use hyperlocal::UnixSocketConnector;
use openssl::x509::X509FileType;
use openssl::ssl::{SslContext, SslMethod};
use rep::Image as ImageRep;
-use rep::{Change, ContainerDetails, Container as ContainerRep, Event, Exit, History, ImageDetails, Info, SearchResult, Stats,
- Status, Top, Version};
+use rep::{Change, ContainerDetails, Container as ContainerRep, Event, Exit, History, ImageDetails,
+ Info, SearchResult, Stats, Status, Top, Version};
use rustc_serialize::json::{self, Json};
use std::env::{self, VarError};
use std::io::Read;
@@ -91,9 +92,17 @@ impl<'a, 'b> Image<'a, 'b> {
xs.iter().map(|j| {
let obj = j.as_object().expect("expected json object");
obj.get("Untagged")
- .map(|sha| Status::Untagged(sha.as_string().expect("expected Untagged to be a string").to_owned()))
+ .map(|sha| {
+ Status::Untagged(sha.as_string()
+ .expect("expected Untagged to be a string")
+ .to_owned())
+ })
.or(obj.get("Deleted")
- .map(|sha| Status::Deleted(sha.as_string().expect("expected Deleted to be a string").to_owned())))
+ .map(|sha| {
+ Status::Deleted(sha.as_string()
+ .expect("expected Deleted to be a string")
+ .to_owned())
+ }))
.expect("expected Untagged or Deleted")
})
}
@@ -151,8 +160,8 @@ impl<'a> Images<'a> {
/// either by name, name:tag, or image id, into a tarball
pub fn export(&self, names: Vec<&str>) -> Result<Box<Read>> {
let params = names.iter()
- .map(|n| ("names", *n))
- .collect::<Vec<(&str, &str)>>();
+ .map(|n| ("names", *n))
+ .collect::<Vec<(&str, &str)>>();
let query = form_urlencoded::serialize(params);
self.docker.stream_get(&format!("/images/get?{}", query)[..])
}
@@ -187,10 +196,7 @@ impl<'a, 'b> Container<'a, 'b> {
pub fn top(&self, psargs: Option<&str>) -> Result<Top> {
let mut path = vec![format!("/containers/{}/top", self.id)];
if let Some(ref args) = psargs {
- let encoded = form_urlencoded::serialize(
- vec![
- ("ps_args", args)
- ]);
+ let encoded = form_urlencoded::serialize(vec![("ps_args", args)]);
path.push(encoded)
}
let raw = try!(self.docker.get(&path.join("?")));