How to specify const array in global scope in Rust?
Using [T; N] is the proper way to do it in most cases; that way there is no boxing of values at all. There is another way, though, which is also useful at times, though it is slightly less efficient (due to pointer indirection): &’static [T]. In your case:— static NUMBERS: &’static [i32] = &[1, … Read more