title: Use C-Like Array of Struct in Rust
body: <p>I need help converting the following C code to Rust.</p>
  
  <pre><code>#define v0   0x0
  #define v1   0x1
  #define v2   0x2
  #define v3   0x3
  
  struct arr {
      u_int v;
      const char *s;
  };
  
  static const struct arr str[] = {
      { v0, "zero"  },
      { v1, "one"   },
      { v2, "two"   },
      { v3, "three" },
      { 0, NULL     }
  };
  </code></pre>
  
  <p>I have the following Rust code already done, but I can't figure out the best way to create an array of structs like the C code does.</p>
  
  <pre><code>static v0: u8 = 0;
  static v1: u8 = 1;
  static v2: u8 = 2;
  static v3: u8 = 3;
  
  struct arr {
      v: u8,
      s: &amp;'static str,
  }
  </code></pre>
  
  <p>I have tried the following code, but to no success:</p>
  
  <pre><code>static str: [arr; 4] = [
      {
          v: v0,
          s:"zero",
      },
      {
          v: v1,
          s:"one",
      },
      {
          v: v2,
          s:"two",
      },
      {
          v: v3,
          s:"three",
      },
  ];
  </code></pre>