Remove semicolons in clippy_utils

This commit is contained in:
mbartlett21 2021-05-25 02:12:27 +00:00
parent 9cad27fce8
commit 0c017ea058
7 changed files with 13 additions and 13 deletions

View File

@ -115,7 +115,7 @@ fn parse_attrs<F: FnMut(u64)>(sess: &Session, attrs: &[ast::Attribute], name: &'
for attr in get_attr(sess, attrs, name) {
if let Some(ref value) = attr.value_str() {
if let Ok(value) = FromStr::from_str(&value.as_str()) {
f(value)
f(value);
} else {
sess.span_err(attr.span, "not a number");
}

View File

@ -223,7 +223,7 @@ pub fn multispan_sugg<I>(diag: &mut DiagnosticBuilder<'_>, help_msg: &str, sugg:
where
I: IntoIterator<Item = (Span, String)>,
{
multispan_sugg_with_applicability(diag, help_msg, Applicability::Unspecified, sugg)
multispan_sugg_with_applicability(diag, help_msg, Applicability::Unspecified, sugg);
}
/// Create a suggestion made from several `span → replacement`.

View File

@ -810,7 +810,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
self.hash_name(f.ident.name);
self.hash_pat(f.pat);
}
e.hash(&mut self.s)
e.hash(&mut self.s);
},
PatKind::Tuple(pats, e) => {
for pat in pats {

View File

@ -667,7 +667,7 @@ pub fn method_chain_args<'a>(expr: &'a Expr<'_>, methods: &[&str]) -> Option<Vec
return None;
}
matched.push(args); // build up `matched` backwards
current = &args[0] // go to parent expression
current = &args[0]; // go to parent expression
} else {
return None;
}
@ -1094,9 +1094,9 @@ pub fn is_refutable(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool {
/// the function once on the given pattern.
pub fn recurse_or_patterns<'tcx, F: FnMut(&'tcx Pat<'tcx>)>(pat: &'tcx Pat<'tcx>, mut f: F) {
if let PatKind::Or(pats) = pat.kind {
pats.iter().copied().for_each(f)
pats.iter().copied().for_each(f);
} else {
f(pat)
f(pat);
}
}

View File

@ -684,7 +684,7 @@ impl<T: LintContext> DiagnosticBuilderExt<T> for rustc_errors::DiagnosticBuilder
if let Some(non_whitespace_offset) = non_whitespace_offset {
remove_span = remove_span
.with_hi(remove_span.hi() + BytePos(non_whitespace_offset.try_into().expect("offset too large")))
.with_hi(remove_span.hi() + BytePos(non_whitespace_offset.try_into().expect("offset too large")));
}
}

View File

@ -59,7 +59,7 @@ impl<'tcx> MutVarsDelegate {
//FIXME: This causes false negatives. We can't get the `NodeId` from
//`Categorization::Upvar(_)`. So we search for any `Upvar`s in the
//`while`-body, not just the ones in the condition.
self.skip = true
self.skip = true;
},
_ => {},
}
@ -71,12 +71,12 @@ impl<'tcx> Delegate<'tcx> for MutVarsDelegate {
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, bk: ty::BorrowKind) {
if let ty::BorrowKind::MutBorrow = bk {
self.update(cmt)
self.update(cmt);
}
}
fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
self.update(cmt)
self.update(cmt);
}
fn fake_read(&mut self, _: rustc_typeck::expr_use_visitor::Place<'tcx>, _: FakeReadCause, _: HirId) {}

View File

@ -87,7 +87,7 @@ where
}
fn visit_stmt(&mut self, stmt: &'hir hir::Stmt<'_>) {
intravisit::walk_stmt(&mut *self.inside_stmt(true), stmt)
intravisit::walk_stmt(&mut *self.inside_stmt(true), stmt);
}
fn visit_expr(&mut self, expr: &'hir hir::Expr<'_>) {
@ -219,7 +219,7 @@ pub fn visit_break_exprs<'tcx>(
fn visit_expr(&mut self, e: &'tcx Expr<'_>) {
if let ExprKind::Break(dest, sub_expr) = e.kind {
self.0(e, dest, sub_expr)
self.0(e, dest, sub_expr);
}
walk_expr(self, e);
}
@ -251,7 +251,7 @@ pub fn is_res_used(cx: &LateContext<'_>, res: Res, body: BodyId) -> bool {
self.found = true;
}
} else {
walk_expr(self, e)
walk_expr(self, e);
}
}
}