Add all the semicolons to clippy_lints

This commit is contained in:
mbartlett21 2021-05-25 01:46:33 +00:00
parent cadad20da1
commit 527fb42a32
15 changed files with 31 additions and 31 deletions

View File

@ -84,7 +84,7 @@ impl<'tcx> LateLintPass<'tcx> for NoNegCompOpForPartialOrd {
types produces code that is hard to read and refactor, please \
consider using the `partial_cmp` method instead, to make it \
clear that the two values could be incomparable"
)
);
}
}
}

View File

@ -123,7 +123,7 @@ fn check_open_options(cx: &LateContext<'_>, options: &[(OpenOption, Argument)],
"the method `create` is called more than once",
);
} else {
create = true
create = true;
}
create_arg = create_arg || (arg == Argument::True);
},
@ -136,7 +136,7 @@ fn check_open_options(cx: &LateContext<'_>, options: &[(OpenOption, Argument)],
"the method `append` is called more than once",
);
} else {
append = true
append = true;
}
append_arg = append_arg || (arg == Argument::True);
},
@ -149,7 +149,7 @@ fn check_open_options(cx: &LateContext<'_>, options: &[(OpenOption, Argument)],
"the method `truncate` is called more than once",
);
} else {
truncate = true
truncate = true;
}
truncate_arg = truncate_arg || (arg == Argument::True);
},
@ -162,7 +162,7 @@ fn check_open_options(cx: &LateContext<'_>, options: &[(OpenOption, Argument)],
"the method `read` is called more than once",
);
} else {
read = true
read = true;
}
read_arg = read_arg || (arg == Argument::True);
},
@ -175,7 +175,7 @@ fn check_open_options(cx: &LateContext<'_>, options: &[(OpenOption, Argument)],
"the method `write` is called more than once",
);
} else {
write = true
write = true;
}
write_arg = write_arg || (arg == Argument::True);
},

View File

@ -88,7 +88,7 @@ impl QuestionMark {
"replace it with",
replacement_str,
applicability,
)
);
}
}
}
@ -129,7 +129,7 @@ impl QuestionMark {
"replace it with",
replacement,
applicability,
)
);
}
}
}

View File

@ -57,7 +57,7 @@ impl<'ast> ast_visit::Visitor<'ast> for ReturnVisitor {
self.found_return = true;
}
ast_visit::walk_expr(self, ex)
ast_visit::walk_expr(self, ex);
}
}

View File

@ -59,7 +59,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
Applicability::MachineApplicable,
);
},
)
);
}
}
}

View File

@ -139,7 +139,7 @@ impl<'tcx> LateLintPass<'tcx> for Return {
} else {
RetReplacement::Empty
};
check_final_expr(cx, &body.value, Some(body.value.span), replacement)
check_final_expr(cx, &body.value, Some(body.value.span), replacement);
},
FnKind::ItemFn(..) | FnKind::Method(..) => {
if let ExprKind::Block(block, _) = body.value.kind {
@ -241,7 +241,7 @@ fn emit_return_lint(cx: &LateContext<'_>, ret_span: Span, inner_span: Option<Spa
if let Some(snippet) = snippet_opt(cx, inner_span) {
diag.span_suggestion(ret_span, "remove `return`", snippet, Applicability::MachineApplicable);
}
})
});
},
None => match replacement {
RetReplacement::Empty => {

View File

@ -120,7 +120,7 @@ fn check_fn<'tcx>(cx: &LateContext<'tcx>, decl: &'tcx FnDecl<'_>, body: &'tcx Bo
let mut bindings = Vec::with_capacity(decl.inputs.len());
for arg in iter_input_pats(decl, body) {
if let PatKind::Binding(.., ident, _) = arg.pat.kind {
bindings.push((ident.name, ident.span))
bindings.push((ident.name, ident.span));
}
}
check_expr(cx, &body.value, &mut bindings);
@ -156,7 +156,7 @@ fn check_local<'tcx>(cx: &LateContext<'tcx>, local: &'tcx Local<'_>, bindings: &
..
} = *local;
if let Some(t) = *ty {
check_ty(cx, t, bindings)
check_ty(cx, t, bindings);
}
if let Some(o) = *init {
check_expr(cx, o, bindings);
@ -324,14 +324,14 @@ fn check_expr<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, bindings: &mut
}
match expr.kind {
ExprKind::Unary(_, e) | ExprKind::Field(e, _) | ExprKind::AddrOf(_, _, e) | ExprKind::Box(e) => {
check_expr(cx, e, bindings)
check_expr(cx, e, bindings);
},
ExprKind::Block(block, _) | ExprKind::Loop(block, ..) => check_block(cx, block, bindings),
// ExprKind::Call
// ExprKind::MethodCall
ExprKind::Array(v) | ExprKind::Tup(v) => {
for e in v {
check_expr(cx, e, bindings)
check_expr(cx, e, bindings);
}
},
ExprKind::If(cond, then, ref otherwise) => {
@ -374,7 +374,7 @@ fn check_ty<'tcx>(cx: &LateContext<'tcx>, ty: &'tcx Ty<'_>, bindings: &mut Vec<(
TyKind::Ptr(MutTy { ty: mty, .. }) | TyKind::Rptr(_, MutTy { ty: mty, .. }) => check_ty(cx, mty, bindings),
TyKind::Tup(tup) => {
for t in tup {
check_ty(cx, t, bindings)
check_ty(cx, t, bindings);
}
},
TyKind::Typeof(ref anon_const) => check_expr(cx, &cx.tcx.hir().body(anon_const.body).value, bindings),

View File

@ -158,7 +158,7 @@ impl SlowVectorInit {
) {
match initialization {
InitializationType::Extend(e) | InitializationType::Resize(e) => {
Self::emit_lint(cx, e, vec_alloc, "slow zero-filling initialization")
Self::emit_lint(cx, e, vec_alloc, "slow zero-filling initialization");
},
};
}
@ -290,7 +290,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VectorInitializationVisitor<'a, 'tcx> {
fn visit_block(&mut self, block: &'tcx Block<'_>) {
if self.initialization_found {
if let Some(s) = block.stmts.get(0) {
self.visit_stmt(s)
self.visit_stmt(s);
}
self.initialization_found = false;

View File

@ -266,7 +266,7 @@ fn emit_suggestion(cx: &EarlyContext<'_>, span: Span, sugg: String, applicabilit
"did you mean",
sugg,
applicability,
)
);
}
fn ident_swap_sugg(
@ -475,7 +475,7 @@ impl Add for IdentLocation {
impl AddAssign for IdentLocation {
fn add_assign(&mut self, other: Self) {
*self = *self + other
*self = *self + other;
}
}
@ -506,7 +506,7 @@ impl Add for IdentDifference {
impl AddAssign for IdentDifference {
fn add_assign(&mut self, other: Self) {
*self = *self + other
*self = *self + other;
}
}

View File

@ -306,7 +306,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &TraitItem<'_>) {
match item.kind {
TraitItemKind::Const(ty, _) | TraitItemKind::Type(_, Some(ty)) => {
self.check_ty(cx, ty, CheckTyContext::default())
self.check_ty(cx, ty, CheckTyContext::default());
},
TraitItemKind::Fn(ref sig, _) => self.check_fn_decl(cx, sig.decl, CheckTyContext::default()),
TraitItemKind::Type(..) => (),
@ -433,7 +433,7 @@ impl Types {
},
TyKind::Slice(ty) | TyKind::Array(ty, _) | TyKind::Ptr(MutTy { ty, .. }) => {
context.is_nested_call = true;
self.check_ty(cx, ty, context)
self.check_ty(cx, ty, context);
},
TyKind::Tup(tys) => {
context.is_nested_call = true;

View File

@ -71,7 +71,7 @@ impl LateLintPass<'_> for Unicode {
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) {
if let ExprKind::Lit(ref lit) = expr.kind {
if let LitKind::Str(_, _) = lit.node {
check_str(cx, lit.span, expr.hir_id)
check_str(cx, lit.span, expr.hir_id);
}
}
}
@ -82,7 +82,7 @@ fn escape<T: Iterator<Item = char>>(s: T) -> String {
for c in s {
if c as u32 > 0x7F {
for d in c.escape_unicode() {
result.push(d)
result.push(d);
}
} else {
result.push(c);

View File

@ -92,7 +92,7 @@ fn check_ident(cx: &EarlyContext<'_>, ident: &Ident, be_aggressive: bool) {
"consider making the acronym lowercase, except the initial letter",
corrected,
Applicability::MaybeIncorrect,
)
);
}
}

View File

@ -356,7 +356,7 @@ impl<'tcx> Visitor<'tcx> for SkipTyCollector {
fn visit_ty(&mut self, hir_ty: &hir::Ty<'_>) {
self.types_to_skip.push(hir_ty.hir_id);
walk_ty(self, hir_ty)
walk_ty(self, hir_ty);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
@ -385,7 +385,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LintTyCollector<'a, 'tcx> {
}
}
walk_ty(self, hir_ty)
walk_ty(self, hir_ty);
}
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {

View File

@ -54,7 +54,7 @@ impl<'tcx> LateLintPass<'tcx> for VerboseFileReads {
"use of `File::read_to_string`",
None,
"consider using `fs::read_to_string` instead",
)
);
}
}
}

View File

@ -300,7 +300,7 @@ impl EarlyLintPass for Write {
Applicability::MachineApplicable,
);
},
)
);
}
}
} else if mac.path == sym!(writeln) {