title: Split string only once in Rust
body: <p>I want to split a string by a separator only once and put it into a tuple. I tried doing</p>
  
  <pre><code>fn splitOnce(in_string: &amp;str) -&gt; (&amp;str, &amp;str) {
      let mut splitter = in_string.split(':');
      let first = splitter.next().unwrap();
      let second = splitter.fold("".to_string(), |a, b| a + b); 
      (first, &amp;second)
  }
  </code></pre>
  
  <p>but I keep getting told that <code>second</code> does not live long enough. I guess it's saying that because <code>splitter</code> only exists inside the function block but I'm not really sure how to address that. How to I coerce <code>second</code> into existing beyond the function block? Or is there a better way to split a string only once?</p>