title: How to flat_map and split from an iterator of Strings
body: <p>Is there a way to make this work without switching to using <code>iter</code> instead of <code>into_iter</code>?</p>
  
  <pre><code>let strings: Vec&lt;String&gt; = vec!["1 2".to_string(), "3 4".to_string()];
  strings.into_iter().flat_map(|str| str.split(" "));
  </code></pre>
  
  <p>The problem is</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0515]: cannot return value referencing function parameter `str`
   --&gt; src/lib.rs:3:40
    |
  3 |     strings.into_iter().flat_map(|str| str.split(" "));
    |                                        ---^^^^^^^^^^^
    |                                        |
    |                                        returns a value referencing data owned by the current function
    |                                        `str` is borrowed here
  </code></pre>
  
  <p>When using <code>iter</code> instead of <code>into_iter</code>, I get an iterator of references and everything works but I'd like to know if it's possible to make this work on an iterator of <code>String</code>s.</p>