heapless
heapless copied to clipboard
feature: initialize with const
When creating a vec, is it possible to use const fn so that the values can be prepared from the beginning?
Only in nightly Rust for now.
Do you plan to achieve an equivalent in stable using macros?
Couldn't the for loop in Vec::from_array be replaced with ptr::copy_nonoverlapping::<T>(ptr::from_ref(&src).cast(), v.buffer.as_mut_ptr().cast(), M)? Then it could be const on 1.83.
Then it would be useful to mark String::from_utf8_unchecked const.
I think discussion can be more alive if you form your suggestion into PR.