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
JSON objects can only have string keys, although HashMaps can have many types of keys. In the case of i32 keys (eg HashMap<i32, i32>), serde_json coerces the stringified integer key (eg "1") into 1i32. However, that fails in the case of bool keys; it raises an error when trying to coerce "true" or "false" into true or false:
JSON objects can only have string keys, although
HashMap
s can have many types of keys. In the case ofi32
keys (egHashMap<i32, i32>
), serde_json coerces the stringified integer key (eg"1"
) into1i32
. However, that fails in the case ofbool
keys; it raises an error when trying to coerce"true"
or"false"
intotrue
orfalse
:I'm assuming the coercion behavior in the
bool
case should be similar to thei32
case.Playground reproduction is here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=92d5a43496299513df591ec5a6f2832c
The text was updated successfully, but these errors were encountered: