#Vector json parsing
5 messages · Page 1 of 1 (latest)
Please post your code examples and compiler output with code fences (```) around them. Example:
`[0m`[0m`rust
let (x, y) = (0, 42);
println!("Position at {}, {}", x, y);
`[0m`[0m`
let (x, y) = (0, 42);
println!("Position at {}, {}", x, y);
If the snippet is long or you want to demonstrate something, consider sharing it through the playground: https://play.rust-lang.org/ or https://www.rustexplorer.com/ or https://paste.rs/web.
Please avoid sharing screenshots of your code, as they're not very accessible. Using code fences or a shared snippet makes the code more readable and allows those helping you to copy-paste the code to help explain things.
Why do you have the square brackets on the outside in the json? Not sure if that's the problem but I don't think they're necessary or typical. They usually enclose an array but you want to deserialize an object/map
yeah so that was actually the problem, i had another file like this:
{
[
"color0": "blue",
"color1": "green",
"color2": "red",
"color3": "purple"
]
}
and it worked, so i didnt really get why this one wasn't working
Ah, gotcha