File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -517,16 +517,9 @@ trait UnusedDelimLint {
517
517
right_pos : Option < BytePos > ,
518
518
) {
519
519
let spans = match value. kind {
520
- ast:: ExprKind :: Block ( ref block, None ) if block. stmts . len ( ) > 0 => {
521
- let start = block. stmts [ 0 ] . span ;
522
- let end = block. stmts [ block. stmts . len ( ) - 1 ] . span ;
523
- if let Some ( start) = start. find_ancestor_inside ( value. span )
524
- && let Some ( end) = end. find_ancestor_inside ( value. span )
525
- {
526
- Some ( (
527
- value. span . with_hi ( start. lo ( ) ) ,
528
- value. span . with_lo ( end. hi ( ) ) ,
529
- ) )
520
+ ast:: ExprKind :: Block ( ref block, None ) if block. stmts . len ( ) == 1 => {
521
+ if let Some ( span) = block. stmts [ 0 ] . span . find_ancestor_inside ( value. span ) {
522
+ Some ( ( value. span . with_hi ( span. lo ( ) ) , value. span . with_lo ( span. hi ( ) ) ) )
530
523
} else {
531
524
None
532
525
}
You can’t perform that action at this time.
0 commit comments