Skip to content

Commit c247281

Browse files
MarcusGrassytmimi
authored andcommitted
Ensure space around binary exprs
1 parent 35c1b7d commit c247281

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/expr.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ pub(crate) fn format_expr(
282282
match lhs.kind {
283283
ast::ExprKind::Lit(token_lit) => lit_ends_in_dot(&token_lit),
284284
ast::ExprKind::Unary(_, ref expr) => needs_space_before_range(context, expr),
285+
ast::ExprKind::Binary(_, ref expr, _) => {
286+
needs_space_before_range(context, expr)
287+
}
285288
_ => false,
286289
}
287290
}

tests/target/issue_6059.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn float_range() {
2+
let _range = 3. / 2. ..4.;
3+
}

0 commit comments

Comments
 (0)