maciejhirsz / json-rust

JSON implementation in Rust
Apache License 2.0
563 stars 63 forks source link

Insert at a given position in `Object` #194

Open timothee-haudebourg opened 3 years ago

timothee-haudebourg commented 3 years ago

Hi,

if I understand well, since #68 the order of an object entries is preserved during parsing. However the Object::insert function still always appends elements at the end. I believe this could be easily improved to allow insertion at any given position.

This would be particularly useful for my json-ld crate, where I sometimes need to add a special "@context" entry preferably in first position.