Open giovvv opened 4 years ago
If your strings are short they will be inlined on stack and use JsonValue::Short
instead of JsonValue::String
.
That said, the next big release of the crate will remove the Short
variant, and use Cow<str>
for strings instead.
When trying to match the elements of a Json array by their type, it seems it is not (easily) possible to do it for strings:
While the
JsonValue::Number
arm works as expected, theJsonValue::String
arm is never entered. Only_ if i.is_string()
works. Perhaps this is the expected behaviour (I'm a rust beginner so I am not sure), but certainly it is not very intuitive...