You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few places where we construct a fixed size array of objects, then run that through map() in order to produce another fixed size array. For example:
let bit_ctx:[_;3] = top_ctx
.iter().map(|ctx| ctx.narrow(&format!("bit{}", bit))).collect::<Vec<_>>().try_into().unwrap();
This is super awkward as you have to iterate the slice, map, collect into a Vec<_>, then use try_into() to maybe create the array, then unwrap that. This would be cleaner, once each_ref() becomes available in mainline rust.
let bit_ctx = top_ctx.each_ref().map(|ctx| ctx.refine(format!("bit{}", bit)));
The text was updated successfully, but these errors were encountered:
There are a few places where we construct a fixed size array of objects, then run that through
map()
in order to produce another fixed size array. For example:This is super awkward as you have to iterate the slice, map, collect into a
Vec<_>
, then usetry_into()
to maybe create the array, then unwrap that. This would be cleaner, onceeach_ref()
becomes available in mainline rust.The text was updated successfully, but these errors were encountered: