File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1074,7 +1074,11 @@ impl Literal {
1074
1074
if !n. is_finite ( ) {
1075
1075
panic ! ( "Invalid float literal {}" , n) ;
1076
1076
}
1077
- Literal ( bridge:: client:: Literal :: float ( & n. to_string ( ) ) )
1077
+ let mut repr = n. to_string ( ) ;
1078
+ if !repr. contains ( '.' ) {
1079
+ repr. push_str ( ".0" ) ;
1080
+ }
1081
+ Literal ( bridge:: client:: Literal :: float ( & repr) )
1078
1082
}
1079
1083
1080
1084
/// Creates a new suffixed floating-point literal.
@@ -1115,7 +1119,11 @@ impl Literal {
1115
1119
if !n. is_finite ( ) {
1116
1120
panic ! ( "Invalid float literal {}" , n) ;
1117
1121
}
1118
- Literal ( bridge:: client:: Literal :: float ( & n. to_string ( ) ) )
1122
+ let mut repr = n. to_string ( ) ;
1123
+ if !repr. contains ( '.' ) {
1124
+ repr. push_str ( ".0" ) ;
1125
+ }
1126
+ Literal ( bridge:: client:: Literal :: float ( & repr) )
1119
1127
}
1120
1128
1121
1129
/// Creates a new suffixed floating-point literal.
You can’t perform that action at this time.
0 commit comments