icu4x
icu4x copied to clipboard
Add validate_with to derive(ULE) and derive(VarULE)
#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.