about summary refs log tree commit diff
diff options
context:
space:
mode:
authory21 <30553356+y21@users.noreply.github.com>2023-06-09 04:57:07 +0200
committery21 <30553356+y21@users.noreply.github.com>2023-06-09 05:21:24 +0200
commit85002b09a1858ea8a7e692f969c3c5946febc898 (patch)
tree6ecebc762bf2350fd2ddc3c73d1efbf9934ec49b
parent60258b061d0e77f97bb40a377a53bb705178c0ba (diff)
downloadrust-85002b09a1858ea8a7e692f969c3c5946febc898.tar.gz
rust-85002b09a1858ea8a7e692f969c3c5946febc898.zip
handle exponent without digits
-rw-r--r--clippy_utils/src/numeric_literal.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/numeric_literal.rs b/clippy_utils/src/numeric_literal.rs
index c225398ad2a..bbe4149fe2a 100644
--- a/clippy_utils/src/numeric_literal.rs
+++ b/clippy_utils/src/numeric_literal.rs
@@ -161,7 +161,7 @@ impl<'a> NumericLiteral<'a> {
         }
 
         if let Some((separator, exponent)) = self.exponent {
-            if exponent != "0" {
+            if !exponent.is_empty() && exponent != "0" {
                 output.push_str(separator);
                 Self::group_digits(&mut output, exponent, group_size, true, false);
             }