title: Is there an owned version of String::chars?
body: <p>The following code does not compile:</p>
  
  <pre><code>use std::str::Chars;
  
  struct Chunks {
      remaining: Chars,
  }
  
  impl Chunks {
      fn new(s: String) -&gt; Self {
          Chunks {
              remaining: s.chars(),
          }
      }
  }
  </code></pre>
  
  <p>The error is:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0106]: missing lifetime specifier
   --&gt; src/main.rs:4:16
    |
  4 |     remaining: Chars,
    |                ^^^^^ expected lifetime parameter
  </code></pre>
  
  <p><code>Chars</code> doesn't own the characters it iterates over and it can't outlive the <code>&amp;str</code> or <code>String</code> it was created from.</p>
  
  <p>Is there an owned version of <code>Chars</code> that does not need a lifetime parameter or do I have to keep a <code>Vec&lt;char&gt;</code> and an index myself?</p>