forked from rust-lang/rustfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source code for example from issue rust-lang#6202
Target code from example issue rust-lang#6202 Corrected indentation and use of spacing for resriting let statements Modified resrite_let to account for trailing ' =' Reduced configs down to what was necessary to reproduce issue Reduced configs down to what was necessary to reproduce issue Documented reason for modifying pat_shape to account for ' =' Moved comment to match rest of codebase's style Fixed issue with accounting for trailing ' =' in let statements Removed trailing space Fixed issue 6202
- Loading branch information
1 parent
6093d48
commit 83af25f
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// rustfmt-max_width: 120 | ||
// rustfmt-version: Two | ||
|
||
impl EarlyLintPass for NeedlessContinue { | ||
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { | ||
if let ExprKind::Loop(body, label, ..) | ExprKind::While(_, body, label) | ExprKind::ForLoop { body, label, .. } = | ||
&expr.kind | ||
&& !in_external_macro(cx.sess, expr.span) | ||
{ | ||
check_final_block_stmt(cx, body, label, expr.span.ctxt()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// rustfmt-max_width: 120 | ||
// rustfmt-version: Two | ||
|
||
impl EarlyLintPass for NeedlessContinue { | ||
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { | ||
if let ExprKind::Loop(body, label, ..) | ||
| ExprKind::While(_, body, label) | ||
| ExprKind::ForLoop { body, label, .. } = &expr.kind | ||
&& !in_external_macro(cx.sess, expr.span) | ||
{ | ||
check_final_block_stmt(cx, body, label, expr.span.ctxt()); | ||
} | ||
} | ||
} |