Skip to content

Commit e583f35

Browse files
Unknownunknown
authored andcommitted
rustfmt
1 parent 3a97b5f commit e583f35

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

clippy_lints/src/functions.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,12 @@ declare_clippy_lint! {
8585
#[derive(Copy, Clone)]
8686
pub struct Functions {
8787
threshold: u64,
88-
max_lines: u64
88+
max_lines: u64,
8989
}
9090

9191
impl Functions {
9292
pub fn new(threshold: u64, max_lines: u64) -> Self {
93-
Self {
94-
threshold,
95-
max_lines
96-
}
93+
Self { threshold, max_lines }
9794
}
9895
}
9996

@@ -190,36 +187,38 @@ impl<'a, 'tcx> Functions {
190187
// Skip the surrounding function decl.
191188
let start_brace_idx = match code_snippet.find("{") {
192189
Some(i) => i + 1,
193-
None => 0
190+
None => 0,
194191
};
195192
let end_brace_idx = match code_snippet.find("}") {
196193
Some(i) => i,
197-
None => code_snippet.len()
194+
None => code_snippet.len(),
198195
};
199196
let function_lines = code_snippet[start_brace_idx..end_brace_idx].lines();
200197

201198
for mut line in function_lines {
202199
code_in_line = false;
203200
loop {
204201
line = line.trim_start();
205-
if line.is_empty() { break; }
202+
if line.is_empty() {
203+
break;
204+
}
206205
if in_comment {
207206
match line.find("*/") {
208207
Some(i) => {
209208
line = &line[i + 2..];
210209
in_comment = false;
211210
continue;
212211
},
213-
None => break
212+
None => break,
214213
}
215214
} else {
216215
let multi_idx = match line.find("/*") {
217216
Some(i) => i,
218-
None => line.len()
217+
None => line.len(),
219218
};
220219
let single_idx = match line.find("//") {
221220
Some(i) => i,
222-
None => line.len()
221+
None => line.len(),
223222
};
224223
code_in_line |= multi_idx > 0 && single_idx > 0;
225224
// Implies multi_idx is below line.len()
@@ -231,12 +230,13 @@ impl<'a, 'tcx> Functions {
231230
break;
232231
}
233232
}
234-
if code_in_line { line_count += 1; }
233+
if code_in_line {
234+
line_count += 1;
235+
}
235236
}
236237

237238
if line_count > self.max_lines {
238-
span_lint(cx, TOO_MANY_LINES, span,
239-
"This function has a large number of lines.")
239+
span_lint(cx, TOO_MANY_LINES, span, "This function has a large number of lines.")
240240
}
241241
}
242242

0 commit comments

Comments
 (0)