File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,9 @@ impl ExcessivePrecision {
98
98
}
99
99
}
100
100
101
- /// Should we exclude the float because it has a .0 suffix
101
+ /// Should we exclude the float because it has a `.0` or `.` suffix
102
102
/// Ex 1_000_000_000.0
103
+ /// Ex 1_000_000_000.
103
104
fn dot_zero_exclusion ( s : & str ) -> bool {
104
105
if let Some ( after_dec) = s. split ( '.' ) . nth ( 1 ) {
105
106
let mut decpart = after_dec
@@ -108,7 +109,8 @@ fn dot_zero_exclusion(s: &str) -> bool {
108
109
109
110
match decpart. next ( ) {
110
111
Some ( '0' ) => decpart. count ( ) == 0 ,
111
- _ => false ,
112
+ Some ( _) => false ,
113
+ None => true ,
112
114
}
113
115
} else {
114
116
false
Original file line number Diff line number Diff line change @@ -54,4 +54,7 @@ fn main() {
54
54
55
55
let good_bige32: f32 = 1E-10 ;
56
56
let bad_bige32: f32 = 1.123_456_788_888E-10 ;
57
+
58
+ // Inferred type
59
+ let good_inferred: f32 = 1f32 * 1_000_000_000. ;
57
60
}
You can’t perform that action at this time.
0 commit comments