From 330950140c0e7477584506f568d1022f6394e4b8 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Wed, 19 Jul 2023 18:16:32 -0700 Subject: [PATCH] fix clippy --- packages/autofmt/src/collect_macros.rs | 2 +- packages/autofmt/src/expr.rs | 2 +- packages/autofmt/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/autofmt/src/collect_macros.rs b/packages/autofmt/src/collect_macros.rs index 8c2fe22f8..10e0d185c 100644 --- a/packages/autofmt/src/collect_macros.rs +++ b/packages/autofmt/src/collect_macros.rs @@ -7,7 +7,7 @@ use syn::{visit::Visit, File, Macro}; type CollectedMacro<'a> = &'a Macro; -pub fn collect_from_file<'a, 'b>(file: &'a File, macros: &'b mut Vec>) { +pub fn collect_from_file<'a>(file: &'a File, macros: &mut Vec>) { MacroCollector::visit_file(&mut MacroCollector { macros }, file); } diff --git a/packages/autofmt/src/expr.rs b/packages/autofmt/src/expr.rs index 56f2e2254..b0257f8c3 100644 --- a/packages/autofmt/src/expr.rs +++ b/packages/autofmt/src/expr.rs @@ -29,7 +29,7 @@ impl Writer<'_> { let first_line = &self.src[start.line - 1]; write!(self.out, "{}", &first_line[start.column - 1..].trim_start())?; - let prev_block_indent_level = crate::leading_whitespaces(&first_line) / 4; + let prev_block_indent_level = crate::leading_whitespaces(first_line) / 4; for (id, line) in self.src[start.line..end.line].iter().enumerate() { writeln!(self.out)?; diff --git a/packages/autofmt/src/lib.rs b/packages/autofmt/src/lib.rs index 5f7e4da03..08e2eadd7 100644 --- a/packages/autofmt/src/lib.rs +++ b/packages/autofmt/src/lib.rs @@ -72,7 +72,7 @@ pub fn fmt_file(contents: &str) -> Vec { let rsx_start = macro_path.span().start(); - writer.out.indent = leading_whitespaces(&writer.src[rsx_start.line - 1]) / 4; + writer.out.indent = leading_whitespaces(writer.src[rsx_start.line - 1]) / 4; write_body(&mut writer, &body);