File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ default = [
31
31
" url" ,
32
32
" uuid" ,
33
33
]
34
- bigdecimal = [" dep:bigdecimal" ]
34
+ bigdecimal = [" dep:bigdecimal" , " dep:ryu " ]
35
35
bson = [" dep:bson" ]
36
36
chrono = [" dep:chrono" ]
37
37
chrono-clock = [" chrono" , " chrono/clock" ]
@@ -59,6 +59,7 @@ graphql-parser = { version = "0.4", optional = true }
59
59
indexmap = { version = " 2.0" , features = [" serde" ] }
60
60
juniper_codegen = { version = " 0.16.0-dev" , path = " ../juniper_codegen" }
61
61
rust_decimal = { version = " 1.20" , default-features = false , optional = true }
62
+ ryu = { version = " 1.0" , optional = true }
62
63
serde = { version = " 1.0.122" , features = [" derive" ] }
63
64
serde_json = { version = " 1.0.18" , default-features = false , optional = true }
64
65
smartstring = " 1.0"
Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ mod bigdecimal_scalar {
44
44
} else if let Some ( f) = v. as_float_value ( ) {
45
45
// See akubera/bigdecimal-rs#103 for details:
46
46
// https://github.com/akubera/bigdecimal-rs/issues/103
47
- BigDecimal :: from_str ( & f. to_string ( ) )
47
+ let mut buf = ryu:: Buffer :: new ( ) ;
48
+ BigDecimal :: from_str ( buf. format ( f) )
48
49
. map_err ( |e| format ! ( "Failed to parse `BigDecimal` from `Float`: {e}" ) )
49
50
} else {
50
51
v. as_string_value ( )
You can’t perform that action at this time.
0 commit comments