title: What is the proper way to create a new generic struct?
body: <p>I'm trying to make a generic struct that can be initialized to something of type <code>T</code>. It looks like this:</p>
  
  <pre><code>pub struct MyStruct&lt;T&gt; {
      test_field: Option&lt;T&gt;,
      name: String,
      age: i32,
  }
  
  impl MyStruct&lt;T&gt; {
      fn new(new_age: i32, new_name: String) -&gt; MyStruct&lt;T&gt; {
          MyStruct&lt;T&gt; {
              test_field: None,
              age: new_age,
              name: new_name,
          }
      }
  }
  </code></pre>
  
  <p>This doesn't seem to work. Among other errors, I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: chained comparison operators require parentheses
   --&gt; src/lib.rs:9:17
    |
  9 |         MyStruct&lt;T&gt; {
    |                 ^^^^^
    |
  </code></pre>