Skip to content

Commit

Permalink
Remove semicolons in clippy_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
mbartlett21 committed May 25, 2021
1 parent 9cad27f commit 0c017ea
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion clippy_utils/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
}

Expand Down
6 changes: 3 additions & 3 deletions clippy_utils/src/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
_ => {},
}
Expand All @@ -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) {}
Expand Down
6 changes: 3 additions & 3 deletions clippy_utils/src/visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<'_>) {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 0c017ea

Please sign in to comment.