diff --git a/Cargo.toml b/Cargo.toml index dc8d250..6444e9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ libc = "0.2" [dev-dependencies] boolinator = "2" -itertools = "0.7" +itertools = "0.8" [features] default = [] diff --git a/examples/list.rs b/examples/list.rs index 9a6082a..87e79f0 100644 --- a/examples/list.rs +++ b/examples/list.rs @@ -3,8 +3,8 @@ extern crate itertools; use itertools::Itertools; -use apt_pkg_native::Cache; use apt_pkg_native::simple; +use apt_pkg_native::Cache; fn main() { let mut cache = Cache::get_singleton(); diff --git a/examples/policy.rs b/examples/policy.rs index 5af3b01..a1abbc7 100644 --- a/examples/policy.rs +++ b/examples/policy.rs @@ -1,8 +1,8 @@ extern crate apt_pkg_native; use std::env; -use apt_pkg_native::Cache; use apt_pkg_native::simple; +use apt_pkg_native::Cache; fn main() { let pkg = env::args() @@ -19,7 +19,8 @@ fn main() { if let Some(view) = found.next() { println!("{}:{}:", view.name(), view.arch()); - let installed_version = view.current_version() + let installed_version = view + .current_version() .unwrap_or_else(|| "(none)".to_string()); println!(" Installed: {}", installed_version); println!( diff --git a/src/citer.rs b/src/citer.rs index 7e9983e..b648432 100644 --- a/src/citer.rs +++ b/src/citer.rs @@ -171,9 +171,11 @@ where fn next(&mut self) -> Option { loop { match self.it.next() { - Some(ref x) => if let Some(y) = (self.f)(x) { - return Some(y); - }, + Some(ref x) => { + if let Some(y) = (self.f)(x) { + return Some(y); + } + } None => return None, } } diff --git a/src/lib.rs b/src/lib.rs index 2943bc5..0276274 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,14 +64,10 @@ mod tests { panic!("not found!"); } - assert!( - cache - .find_by_name( - "this-package-doesnt-exist-and-if-someone-makes-it-ill-be-really-angry" - ) - .next() - .is_none() - ); + assert!(cache + .find_by_name("this-package-doesnt-exist-and-if-someone-makes-it-ill-be-really-angry") + .next() + .is_none()); } #[test] diff --git a/src/simple.rs b/src/simple.rs index 8ab444d..861f44e 100644 --- a/src/simple.rs +++ b/src/simple.rs @@ -122,8 +122,11 @@ impl Origin { impl fmt::Display for Origin { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // trying to simulate apt-cache policy, but a lot of information is missing - if self.site.is_some() && self.origin.is_some() && self.label.is_some() - && self.codename.is_some() && self.architecture.is_some() + if self.site.is_some() + && self.origin.is_some() + && self.label.is_some() + && self.codename.is_some() + && self.architecture.is_some() { write!( f, @@ -153,7 +156,8 @@ impl VersionOrigins { pub fn new(view: &sane::VerView) -> Self { VersionOrigins { version: Version::new(view), - origins: view.origin_iter() + origins: view + .origin_iter() .map(|o| { Origin::from_ver_file(o) .expect("a version's origin should always have a backing file")