title: Create sum of ones till N using macro in Rust
body: <p>I would like to create a macro for transforming <code>count!(5)</code> into <code>1+1+1+1+1</code>.
  The final reason is to use <code>count!(N) - 1</code> into a structure definition where <code>N</code> is a const generics.</p>
  <pre class="lang-rust prettyprint-override"><code>macro_rules! count {
      (1) =&gt; {0};
      (2) =&gt; { 1 + count!(1)};
      ($n: tt) =&gt; { 1 + count!($n - 1)};
  }
  
  struct WindowIterator&lt;I, Item, const N: usize&gt; {
      iter: I,
      values: Box&lt;[Item; count!(N) - 1 ]&gt;,
      index: usize,
  }
  
  </code></pre>
  <p>With this definition, I receive an error like <code>no rules expected the token </code>N<code> </code>.</p>
  <p>How can I change my code for making it correct?</p>