chanced / jsonptr

JSON Pointer (RFC 6901) implementation for Rust
Apache License 2.0
44 stars 4 forks source link

add repr transparent to `Pointer` #49

Closed asmello closed 1 month ago

asmello commented 1 month ago

I missed this when first implementing the slice-like Pointer type. I think the compiler will use the same layout as str regardless, but it's important to make sure. This assumption is needed for the unsafe code used in this type to be sound.

chanced commented 1 month ago

Awesome! Should we do the same for PointerBuf?

asmello commented 1 month ago

No, PointerBuf doesn't have any unsafe code that relies on the internal layout of the type. 👍

chanced commented 1 month ago

Awesome, thanks.

heh, as an aside, I really need to get better about proofreading my comments written on my phone. So many incoherent sentences 🤦‍♂️