title: How to split string into chunks in Rust to insert spaces
body: <p>I'm attempting to learn Rust. And a recent problem I've encountered is the following:
  given a <code>String</code>, that is exactly some multiple of n, I want to split the string into chunks of size n, and insert a space in between these chunks, then collect back into a single string.</p>
  <p>The issue I was running into, is that the <code>chars()</code> method returns the <code>Chars</code> struct, which for some reason doesn't implement the <code>SliceConcatExt</code> trait, so <code>chunks()</code> can't be called on it.</p>
  <p>Furthermore, once I've successfully created a Chunks struct (by calling <code>.bytes()</code> instead) I'm unsure how to call a <code>.join(' ')</code> since the elements are now <code>Chunks</code> of byte slices...</p>
  <p>There has to be an elegant way to do this I'm missing.</p>
  <p>For example here is an input / output that illustrates the situation:</p>
  <pre><code>given: whatupmyname, 4
  output: what upmy name
  </code></pre>
  <p>This is my poorly written attempt:</p>
  <pre class="lang-rust prettyprint-override"><code>let n = 4;
  let text = &quot;whatupmyname&quot;.into_string();
  text.chars()
      // compiler error on chunks() call
      .chunks(n)
      .collect::&lt;Vec&lt;String&gt;&gt;()
      .join(' ')
  </code></pre>