You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Stable**: No (tracking issue: [#6471](https://github.com/rust-lang/rustfmt/issues/6471))
1266
+
1267
+
#### `Preserve` (default):
1268
+
1269
+
Leave the literal as-is.
1270
+
1271
+
```rust
1272
+
fnmain() {
1273
+
letvalues= [1.0, 2., 3.0e10, 4f32];
1274
+
}
1275
+
```
1276
+
1277
+
#### `Always`:
1278
+
1279
+
Add a trailing zero to the literal:
1280
+
1281
+
```rust
1282
+
fnmain() {
1283
+
letvalues= [1.0, 2.0, 3.0e10, 4.0f32];
1284
+
}
1285
+
```
1286
+
1287
+
#### `IfNoPostfix`:
1288
+
1289
+
Add a trailing zero by default. If the literal contains an exponent or a suffix, the zero
1290
+
and the preceding period are removed:
1291
+
1292
+
```rust
1293
+
fnmain() {
1294
+
letvalues= [1.0, 2.0, 3e10, 4f32];
1295
+
}
1296
+
```
1297
+
1298
+
#### `Never`:
1299
+
1300
+
Remove the trailing zero. If the literal contains an exponent or a suffix, the preceding
1301
+
period is also removed:
1302
+
1303
+
```rust
1304
+
fnmain() {
1305
+
letvalues= [1., 2., 3e10, 4f32];
1306
+
}
1307
+
```
1308
+
1259
1309
## `hide_parse_errors`
1260
1310
1261
1311
This option is deprecated and has been renamed to `show_parse_errors` to avoid confusion around the double negative default of `hide_parse_errors=false`.
0 commit comments