News for hackers. Stuff that matters.
Re:How to make your C codebase Rusty: rewriting keyboard fir... by petschge on Friday November 22, 2019 @10:04AM (#21606137)
and why can't we write it like you just did, with outer to inner dimensions going from left to right, i.e. in the same order the indices go when we actually use elements?
Re:How to make your C codebase Rusty: rewriting keyboard fir... by pitaj on Friday November 22, 2019 @12:54PM (#21608053)
Array filling shares syntax with array typing and array declaration:

    [0; 10] // ten-element array filled with zeros
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // equivalent array with ten zeroes typed out
    [i32; 10] // type of ten-element i32 array
Because the "filling" syntax is optional, it makes sense to place it after the fill value. The array typing syntax follows. Essentially you specify the value and say "copy this X times" (it only works with types that implement Copy IIRC)

https://play.rust-lang.org/?version=stable&mode=debug&editio...