←back to thread

611 points LorenDB | 1 comments | | HN request time: 0.277s | source
Show context
nyanpasu64 ◴[] No.43910223[source]
The problem I've always had with unit type wrappers is you can't convert between a &[f32] and a &[Amplitude<f32>] like you can convert a single scalar value.
replies(2): >>43910307 #>>43912786 #
1. fvncc ◴[] No.43910307[source]
There are libraries that help with these conversions. See e.g.: https://docs.rs/bytemuck/latest/bytemuck/trait.TransparentWr...