Repository: jinxdash/prettier-plugin-rust (language: rust)

Issue:
No-op float exponents format to integers
### Input code

```rust
1e0;
```


### Output code

```rust
1;
```


### Additional context

Expected `1.0;`


Discussion / hints:

Fix patch:
diff --git a/src/format/core.ts b/src/format/core.ts
index 0284f5f..c65ddb1 100644
--- a/src/format/core.ts
+++ b/src/format/core.ts
@@ -64,7 +64,7 @@ import {
 	UnionDeclaration,
 	UnionPattern,
 	WhileBlockExpression,
-	YieldExpression
+	YieldExpression,
 } from "jinx-rust";
 import {
 	DelimChars,
@@ -147,7 +147,7 @@ import {
 	is_UnwrapExpression,
 	is_VariableDeclarationNode,
 	ownStart,
-	start
+	start,
 } from "jinx-rust/utils";
 import { assert, AssertTypesEq, exit, find_last, flat, Identity, iLast, last_of, Map_get, Narrow, spread } from "../utils/common";
 import {
@@ -163,7 +163,7 @@ import {
 	isPreviousLineEmpty,
 	printCommentsSeparately,
 	printDanglingComments,
-	withComments
+	withComments,
 } from "./comments";
 import {
 	hasComplexGenerics,
@@ -172,7 +172,7 @@ import {
 	hasComplexTypeArguments,
 	hasComplexTypeBounds,
 	isShortGenericParameterDeclaration,
-	is_short
+	is_short,
 } from "./complexity";
 import {
 	align,
@@ -198,7 +198,7 @@ import {
 	lineSuffixBoundary,
 	removeLines,
 	softline,
-	willBreak
+	willBreak,
 } from "./external";
 import {
 	f,
@@ -211,7 +211,7 @@ import {
 	is_printing_macro,
 	pathCall,
 	pathCallEach,
-	print
+	print,
 } from "./plugin";
 import { canInlineBlockBody, emptyContent, needsParens, shouldFlatten } from "./styling";
 import { BlockLikeMacroInvocation, CallLikeMacroInvocation, is_CallExpression_or_CallLikeMacroInvocation } from "./transform";
@@ -287,6 +287,7 @@ export function printNumber(rawNumber: string) {
 	return rawNumber
 		.toLowerCase()
 		.replace(/^([\d.]+e)(?:\+|(-))?0*(\d)/, "$1$2$3")
+		.replace(/^(\d+)e[+-]?0+$/, "$1.0")
 		.replace(/^([\d.]+)e[+-]?0+$/, "$1")
 		.replace(/\.(\d+?)0+(?=e|$)/, ".$1")
 		.replace(/\.(?=e|$)/, ".0");
@@ -547,7 +548,6 @@ export function printRuleMatch<T extends MacroRuleDeclaration | MacroInlineRuleD
 				return isParamsLike || is_tk(next) ? " " : line;
 			}
 
-			
 			const next_1 = next !== last_of(arr) && arr[arr.indexOf(next) + 1];
 			if (is_ident(item) && is_DelimGroup(next) && next.segments.dk === DelimKind["()"]) {
 				if (!next_1 || !is_match_any(next_1)) {
diff --git a/src/format/macros/cfg_if.ts b/src/format/macros/cfg_if.ts
index 8988d98..f1cec03 100644
--- a/src/format/macros/cfg_if.ts
+++ b/src/format/macros/cfg_if.ts
@@ -1,5 +1,4 @@
 import {
-	BlockLike,
 	DelimGroup,
 	DelimKind,
 	IfBlockExpression,
@@ -14,7 +13,7 @@ import {
 	TK,
 } from "jinx-rust";
 import { insertNodes, start, transferAttributes } from "jinx-rust/utils";
-import { assert, iLast, spliceAll } from "../../utils/common";
+import { assert, iLast } from "../../utils/common";
 import { isGroup, isIdent, isToken } from "./utils";
 
 export function transform_macro_cfg_if(segments: MacroInvocation["segments"]) {


Test patch:
diff --git a/tests/output-ext/expressions/literal.f.rs b/tests/output-ext/expressions/literal.f.rs
index ebb0347..63fbc6d 100644
--- a/tests/output-ext/expressions/literal.f.rs
+++ b/tests/output-ext/expressions/literal.f.rs
@@ -102,7 +102,7 @@
   ),
   (-16 >> 2, a.0 - 1, a.0.1..2, (0).b0),
   ('\u{10__FFFF}', "\u{10_F0FF__}foo\u{1_0_0_0__}"),
-  (0, 1, 0.1, 1.1, 1, 1.005, 1.0, 1.5, 1.5, 0.005, 0.0, 0.0),
+  (0, 1, 0.1, 1.1, 1.0, 1.005, 1.0, 1.5, 1.5, 0.005, 0.0, 0.0),
   (0b1, 0B1, 0o1, 0O1, 0x1, 0X1),
   (0x123abcdef456abcdef, 0X123abcdef456ABCDEF, 0xdeadbeef),
   (