From cb5cb1b831ace6f30817a791c4d79a613ad508fd Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Wed, 20 Jun 2018 13:50:49 +0300 Subject: [PATCH] ci: update nightly to 2018-06-19, clippy to 0.0.209 --- .travis.yml | 6 +++--- src/manifest.rs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index f36f704928..018f0ced0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,11 @@ matrix: script: - rustfmt -V - cargo fmt -- --write-mode diff - - rust: nightly-2018-02-14 + - rust: nightly-2018-06-19 before_script: - - cargo install clippy --vers 0.0.186 + - cargo install clippy --vers 0.0.209 script: - - cargo clippy -- -D warnings + - cargo clippy -- -D warnings -A renamed_and_removed_lints -A print_literal allow_failures: - rust: nightly before_script: diff --git a/src/manifest.rs b/src/manifest.rs index 7b7afad3ba..028a17f857 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -87,7 +87,7 @@ fn merge_dependencies(old_dep: &mut toml_edit::Item, new: &Dependency) { unreachable!("Invalid old dependency type"); } - old_dep.as_inline_table_mut().map(|t| t.fmt()); + if let Some(t) = old_dep.as_inline_table_mut() { t.fmt() } } /// Print a message if the new dependency version is different from the old one. @@ -121,9 +121,9 @@ fn print_upgrade_if_necessary( buffer .set_color(&ColorSpec::new()) .chain_err(|| "Failed to clear output colour")?; - write!( + writeln!( &mut buffer, - "{} v{} -> v{}\n", + "{} v{} -> v{}", crate_name, old_version, new_version, ).chain_err(|| "Failed to write upgrade versions")?; bufwtr @@ -254,7 +254,7 @@ impl Manifest { } else { // update an existing entry merge_dependencies(&mut table[&dep.name], dep); - table.as_inline_table_mut().map(|t| t.fmt()); + if let Some(t) = table.as_inline_table_mut() { t.fmt() } } Ok(()) } @@ -276,7 +276,7 @@ impl Manifest { } if !dry_run { merge_dependencies(&mut table[&dep.name], dep); - table.as_inline_table_mut().map(|t| t.fmt()); + if let Some(t) = table.as_inline_table_mut() { t.fmt() } } } @@ -374,7 +374,7 @@ impl LocalManifest { let path = path.to_path_buf(); Ok(LocalManifest { manifest: Manifest::open(&Some(path.clone()))?, - path: path, + path, }) }