icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Add validate_with to derive(ULE) and derive(VarULE)

Open sffc opened this issue 3 years ago • 0 comments

#1691

Note that Serde does this differently using serde(try_from) (see https://github.com/serde-rs/serde/issues/939). However, since ULE types are dealt with by reference, and there isn't a safe way to transmute &A to &Transparent<A>, the try_from thing doesn't make sense for ULE. So, I made it a validate_with function instead.

If we add a better way to go from &A to &Transparent<A>, then we could use the try_from thing.

sffc avatar Oct 09 '22 02:10 sffc