diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-05 21:19:36 +0100 |
|---|---|---|
| committer | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2022-01-05 17:53:27 -0600 |
| commit | 5056f4cfb311a084420f1828cd58af94d143f5e0 (patch) | |
| tree | 333cdc28fe6115c02f2bc8677125c5b1c85404f9 | |
| parent | 34d374ee5d23951d166ca3f51d477ddf6526a2fa (diff) | |
| download | rust-5056f4cfb311a084420f1828cd58af94d143f5e0.tar.gz rust-5056f4cfb311a084420f1828cd58af94d143f5e0.zip | |
some minor clippy fixes
| -rw-r--r-- | src/cargo-fmt/main.rs | 3 | ||||
| -rw-r--r-- | src/format_report_formatter.rs | 1 | ||||
| -rw-r--r-- | src/macros.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/cargo-fmt/main.rs b/src/cargo-fmt/main.rs index 759b21218c3..8cb7b4585ec 100644 --- a/src/cargo-fmt/main.rs +++ b/src/cargo-fmt/main.rs @@ -387,8 +387,7 @@ fn get_targets_root_only( .unwrap_or_default() == current_dir_manifest }) - .map(|p| p.targets) - .flatten() + .flat_map(|p| p.targets) .collect(), }; diff --git a/src/format_report_formatter.rs b/src/format_report_formatter.rs index c820259256c..90406cdb95e 100644 --- a/src/format_report_formatter.rs +++ b/src/format_report_formatter.rs @@ -20,6 +20,7 @@ impl<'a> FormatReportFormatterBuilder<'a> { } /// Enables colors and formatting in the output. + #[must_use] pub fn enable_colors(self, enable_colors: bool) -> Self { Self { enable_colors, diff --git a/src/macros.rs b/src/macros.rs index f29552caf8d..fdbe3374615 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -152,7 +152,7 @@ pub(crate) fn rewrite_macro( ) -> Option<String> { let should_skip = context .skip_context - .skip_macro(&context.snippet(mac.path.span).to_owned()); + .skip_macro(context.snippet(mac.path.span)); if should_skip { None } else { |
