Skip to content

Commit 4e8cd4d

Browse files
committed
Fix NumericLiteral::format that may produce a invalid literal
1 parent 04aa3f7 commit 4e8cd4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clippy_utils/src/numeric_literal.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ impl<'a> NumericLiteral<'a> {
162162
}
163163

164164
if let Some(suffix) = self.suffix {
165+
if output.ends_with('.') {
166+
output.push('0');
167+
}
165168
output.push('_');
166169
output.push_str(suffix);
167170
}

0 commit comments

Comments
 (0)