maciejhirsz / json-rust

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

`stringify` and `stringify_pretty` consume a `JsonValue` #198

Open bsdinis opened 3 years ago

bsdinis commented 3 years ago

I see no reason why they cannot take an immutable reference to a JsonValue.

This would probably save a lot of cloneing.

jurosic commented 1 year ago

I noticed this too, i looked into the code and it seems it actually just calls the .pretty() method on the JsonValue object, so instad of using stringify_pretty you can use .pretty()