risingwavelabs / jsonbb

A binary representation of json value, optimized for parsing and querying.
Apache License 2.0
22 stars 0 forks source link

bug: unsafe violation on ValueRef #6

Open andylokandy opened 5 days ago

andylokandy commented 5 days ago

https://github.com/risingwavelabs/jsonbb/blob/bc93534cc38a11ca01da5fbe32eb53d09350e54b/src/value_ref.rs#L207-L210

This unsafe is not always valid because user can construct the ValueRef via ValueRef::String("hello world")

wangrunji0408 commented 4 days ago

Yes. A possible solution is to wrap the &str in a new type to prevent user from constructing it.