Skip to content

Commit d84c35a

Browse files
committed
style: use rustfmt
1 parent fec2eba commit d84c35a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

compiler/rustc_interface/src/passes.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,14 @@ fn early_lint_checks(tcx: TyCtxt<'_>, (): ()) {
325325

326326
// sort by spans
327327
symbols.sort_unstable_by_key(|k| k.1);
328-
let ferris_fix = match symbols.binary_search_by(|(_, span)| span.cmp(&&first_span)) {
328+
let ferris_fix = match symbols.binary_search_by(|(_, span)| span.cmp(&&first_span))
329+
{
329330
Ok(index) | Err(index) if index > 0 => {
330331
let keyword = symbols[index - 1].0.as_str();
331332
// if we have e.g. `static mut`
332333
if keyword == "mut" {
333-
let keyword_before = symbols.get(index - 2).map(|s| s.0.as_str()).unwrap_or_default();
334+
let keyword_before =
335+
symbols.get(index - 2).map(|s| s.0.as_str()).unwrap_or_default();
334336
if keyword_before == "static" {
335337
FerrisFix::ScreamingSnakeCase
336338
} else {
@@ -339,13 +341,16 @@ fn early_lint_checks(tcx: TyCtxt<'_>, (): ()) {
339341
} else {
340342
match keyword {
341343
"const" | "static" => FerrisFix::ScreamingSnakeCase,
342-
"struct" | "trait" | "mod" | "union" | "type" | "enum" => FerrisFix::PascalCase,
344+
"struct" | "trait" | "mod" | "union" | "type" | "enum" => {
345+
FerrisFix::PascalCase
346+
}
343347
_ => FerrisFix::SnakeCase,
344348
}
345349
}
346-
},
350+
}
347351
_ => FerrisFix::SnakeCase,
348-
}.as_str();
352+
}
353+
.as_str();
349354

350355
sess.dcx().emit_err(errors::FerrisIdentifier { spans, first_span, ferris_fix });
351356
} else {

0 commit comments

Comments
 (0)