Skip to content

Commit 5703cc3

Browse files
committed
Ensure space around binary exprs
1 parent b5dcc6f commit 5703cc3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/expr.rs

+3
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

+3
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)