From 69e262df59f4cafd9547ec706d89fe8e4beb6b73 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Tue, 11 Oct 2016 13:47:45 -0400 Subject: [PATCH] Run `cargo fmt` --- src/pod.rs | 11 ++++++----- src/project.rs | 2 +- src/service_locations.rs | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pod.rs b/src/pod.rs index 657f307d..95d87edb 100644 --- a/src/pod.rs +++ b/src/pod.rs @@ -74,11 +74,13 @@ impl FileInfo { // confusing and unmaintanable overrides, and (2) the rest of this // program's design assumes it doesn't have to worry about them. let ours: BTreeSet = self.file.services.keys().cloned().collect(); - let introduced: Vec = ours.difference(service_names).cloned().collect(); + let introduced: Vec = + ours.difference(service_names).cloned().collect(); if !introduced.is_empty() { return Err(ErrorKind::ServicesAddedInOverride(base_file.to_owned(), self.rel_path.clone(), - introduced).into()) + introduced) + .into()); } // Add any missing services. @@ -258,8 +260,7 @@ impl Pod { } /// Look up a service by name. - pub fn service(&self, ovr: &Override, name: &str) - -> Result> { + pub fn service(&self, ovr: &Override, name: &str) -> Result> { let file = try!(self.merged_file(ovr)); Ok(file.services.get(name).cloned()) } @@ -267,7 +268,7 @@ impl Pod { /// Like `service`, but returns an error if the service can't be found. pub fn service_or_err(&self, ovr: &Override, name: &str) -> Result { try!(self.service(ovr, name)) - .ok_or_else(|| { ErrorKind::UnknownService(name.to_owned()).into() }) + .ok_or_else(|| ErrorKind::UnknownService(name.to_owned()).into()) } /// Command-line `-p` and `-f` arguments that we'll pass to diff --git a/src/project.rs b/src/project.rs index 6f912ec6..377f1af3 100644 --- a/src/project.rs +++ b/src/project.rs @@ -263,7 +263,7 @@ impl Project { /// Like `service`, but returns an error if the service is unknown. pub fn service_or_err<'a>(&self, name: &'a str) -> Result<(&Pod, &str)> { self.service(name) - .ok_or_else(|| { ErrorKind::UnknownService(name.to_owned()).into() }) + .ok_or_else(|| ErrorKind::UnknownService(name.to_owned()).into()) } /// Iterate over all overrides in this project. diff --git a/src/service_locations.rs b/src/service_locations.rs index 1ce7111a..e0a19120 100644 --- a/src/service_locations.rs +++ b/src/service_locations.rs @@ -14,7 +14,7 @@ use pod::Pod; #[derive(Debug)] pub struct ServiceLocations { /// Our location information. - locations: BTreeMap + locations: BTreeMap, } impl ServiceLocations { @@ -65,7 +65,8 @@ impl ServiceLocations { /// Find a service by name. pub fn find<'a>(&self, service_name: &'a str) -> Option<(&str, &str)> { - self.locations.get(service_name) + self.locations + .get(service_name) .map(|&(ref pod, ref service)| (&pod[..], &service[..])) } }