Yeah, consistency is good, which is why it’s good to follow the spec. I’m saying that the decision to make errors be flat strings in the spec was a bad one. A better design would be what you have, where code
is nested one level below error
, plus permitting extra implementation-defined fields in that object.
The spec requires errors to be a single string, and also mandates using the space character as a separator? I’m not a fan of deviating from spec, but those are…bad choices in the spec.
I don’t think it’s fair to consider unsafe Rust such a small subset of the language that it requires calling it out as a separate thing from “Rust” in the title of an article. Unsafe constructs are necessary in the standard library and many crates, whether or not you use it in the code you actually write.