Skip to content

Commit a609afb

Browse files
refactor: update unsuffixed float detection
1 parent 30ed45b commit a609afb

File tree

1 file changed

+2
-1
lines changed
  • rustfmt-core/rustfmt-lib/src

1 file changed

+2
-1
lines changed

rustfmt-core/rustfmt-lib/src/expr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ pub(crate) fn format_expr(
252252
fn needs_space_before_range(context: &RewriteContext<'_>, lhs: &ast::Expr) -> bool {
253253
match lhs.kind {
254254
ast::ExprKind::Lit(ref lit) => match lit.kind {
255-
ast::LitKind::FloatUnsuffixed(..) => {
255+
ast::LitKind::Float(_, ref float_type) if ast::LitFloatType::Unsuffixed == *float_type =>
256+
{
256257
context.snippet(lit.span).ends_with('.')
257258
}
258259
_ => false,

0 commit comments

Comments
 (0)