File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -140,21 +140,22 @@ impl SemicolonBlock {
140
140
impl LateLintPass < ' _ > for SemicolonBlock {
141
141
fn check_stmt ( & mut self , cx : & LateContext < ' _ > , stmt : & Stmt < ' _ > ) {
142
142
match stmt. kind {
143
- StmtKind :: Expr ( Expr {
144
- kind : ExprKind :: Block ( block, _) ,
145
- ..
146
- } ) if !block. span . from_expansion ( ) && stmt. span . contains ( block. span ) => {
143
+ StmtKind :: Expr ( expr)
144
+ if let ExprKind :: Block ( block, _) = expr. kind
145
+ && !block. span . from_expansion ( )
146
+ && stmt. span . contains ( block. span ) =>
147
+ {
147
148
if block. expr . is_none ( )
148
149
&& let [ .., stmt] = block. stmts
149
150
&& let StmtKind :: Semi ( expr) = stmt. kind
150
151
{
151
152
self . semicolon_outside_block ( cx, block, expr) ;
152
153
}
153
154
} ,
154
- StmtKind :: Semi ( Expr {
155
- kind : ExprKind :: Block ( block, _) ,
156
- ..
157
- } ) if !block . span . from_expansion ( ) => {
155
+ StmtKind :: Semi ( expr )
156
+ if let ExprKind :: Block ( block, _) = expr . kind
157
+ && !block . span . from_expansion ( ) =>
158
+ {
158
159
if let Some ( tail) = block. expr {
159
160
self . semicolon_inside_block ( cx, block, tail, stmt. span ) ;
160
161
}
You can’t perform that action at this time.
0 commit comments