Leverage zeroslice!
macro to clean up ZeroVec API
#1935
Labels
C-zerovec
Component: Yoke, ZeroVec, DataBake
S-small
Size: One afternoon (small bug fix or enhancement)
T-techdebt
Type: ICU4X code health and tech debt
Milestone
With Rust 1.61 and #1926, we will now be able to do the following:
zeroslice!
macroconst
constructorsEqULE
trait to use the new convenience macro, and then removeEqULE
For the macro, you should be able to write
which desugars to
where
<cb>
is a const function that converts from an aligned to unaligned array (i.e.AsULE::to_unaligned
); it would be nice to have a trait for this but we still can't use trait functions in a const context. We can probably write it such that the function only needs to convert from a singleT
to a singleT::ULE
and call it in a loop. The big thing is that we can writeZeroSlice::from_ule_slice
in a const context now.The text was updated successfully, but these errors were encountered: