pdl: Use num-traits in canonical tests
The FromPrimitive and ToPrimitive traits allow us to be generic over
the value types in the canonical tests.
This is helpful when we introduce support for enums: there we will
need to convert to/from non-integer types and we will have to do so
without knowing the actual type when we generate the code. The traits
allow us to do so in a generic way.
Test: atest pdl_rust_generator_tests_{le,be}
(cherry picked from https://android-review.googlesource.com/q/commit:f49babb77d5e2b0114ea8ce2ef5d9614776c93ec)
Merged-In: I11542ff298d924a0f6d0492445267c9efe37ace8
Change-Id: I11542ff298d924a0f6d0492445267c9efe37ace8
Loading
Please register or sign in to comment