bump dev dependency / fmt

This commit is contained in:
Chris West (Faux) 2018-12-17 19:04:09 +00:00
parent 46ad5e2bb2
commit 7f180bc3ef
6 changed files with 21 additions and 18 deletions

View File

@ -23,7 +23,7 @@ libc = "0.2"
[dev-dependencies]
boolinator = "2"
itertools = "0.7"
itertools = "0.8"
[features]
default = []

View File

@ -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();

View File

@ -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!(

View File

@ -171,9 +171,11 @@ where
fn next(&mut self) -> Option<Self::Item> {
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,
}
}

View File

@ -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]

View File

@ -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")