浏览代码

fix clippy

Evan Almloff 1 年之前
父节点
当前提交
330950140c
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      packages/autofmt/src/collect_macros.rs
  2. 1 1
      packages/autofmt/src/expr.rs
  3. 1 1
      packages/autofmt/src/lib.rs

+ 1 - 1
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<CollectedMacro<'a>>) {
+pub fn collect_from_file<'a>(file: &'a File, macros: &mut Vec<CollectedMacro<'a>>) {
     MacroCollector::visit_file(&mut MacroCollector { macros }, file);
 }
 

+ 1 - 1
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)?;

+ 1 - 1
packages/autofmt/src/lib.rs

@@ -72,7 +72,7 @@ pub fn fmt_file(contents: &str) -> Vec<FormattedBlock> {
 
         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);