From 629e8d1ed0aeabf27a1e1b1d3c8c9134716043e3 Mon Sep 17 00:00:00 2001 From: Clemens Wasser Date: Thu, 3 Jun 2021 12:46:56 +0200 Subject: Apply more clippy suggestions and update generated --- xtask/src/release/changelog.rs | 4 ++-- xtask/src/tidy.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'xtask') diff --git a/xtask/src/release/changelog.rs b/xtask/src/release/changelog.rs index ffcae2cf7..2384a746f 100644 --- a/xtask/src/release/changelog.rs +++ b/xtask/src/release/changelog.rs @@ -132,7 +132,7 @@ fn parse_changelog_line(s: &str) -> Option { return Some(PrInfo { kind, message: Some(message) }); } }; - let res = PrInfo { kind, message }; + let res = PrInfo { message, kind }; Some(res) } @@ -152,7 +152,7 @@ fn parse_title_line(s: &str) -> PrInfo { PrKind::Skip => None, _ => Some(s[prefix.len()..].to_string()), }; - return PrInfo { kind, message }; + return PrInfo { message, kind }; } } PrInfo { kind: PrKind::Other, message: Some(s.to_string()) } diff --git a/xtask/src/tidy.rs b/xtask/src/tidy.rs index 6f687a788..e1a62da27 100644 --- a/xtask/src/tidy.rs +++ b/xtask/src/tidy.rs @@ -33,7 +33,7 @@ fn check_code_formatting() { let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); crate::ensure_rustfmt().unwrap(); let res = cmd!("cargo fmt -- --check").run(); - if !res.is_ok() { + if res.is_err() { let _ = cmd!("cargo fmt").run(); } res.unwrap() @@ -244,19 +244,19 @@ Zlib OR Apache-2.0 OR MIT .map(|it| it.trim()) .map(|it| it[r#""license":"#.len()..].trim_matches('"')) .collect::>(); - licenses.sort(); + licenses.sort_unstable(); licenses.dedup(); if licenses != expected { let mut diff = String::new(); - diff += &format!("New Licenses:\n"); + diff += &"New Licenses:\n".to_string(); for &l in licenses.iter() { if !expected.contains(&l) { diff += &format!(" {}\n", l) } } - diff += &format!("\nMissing Licenses:\n"); + diff += &"\nMissing Licenses:\n".to_string(); for &l in expected.iter() { if !licenses.contains(&l) { diff += &format!(" {}\n", l) -- cgit v1.2.3