I am a beginner at rust, so...
I was working with some json data today, reading and extracting data from it, using serde_json. In many cases I got a jason node as a serde_json::Value, which is an option type. I know that it was a Vallue::Array(v) type but had to keep writing stuff like this:
if let Value::Array(items) = items {
for item in items {
/// do something with each item
}
}
Is this the only way to do this? It is very verbose. Is there a better way the is more rust-ish?
(and I know that I could read json into real objects, but that is not the issue here)
Thanks.