title: In Rust, what's the idiomatic way to split a &str into an iterator of &strs of one character each?
body: <p>If I want to take a <code>&amp;str</code> like <code>"aeiou"</code> and turn it into an iterator roughly equivalent to <code>["a", "e", "i", "o", "u"].iter()</code>, what's the most idiomatic way to do it?</p>
  
  <p>I've tried doing <code>"aeiou".split("")</code> which seemed idiomatic to me, but I got empty <code>&amp;str</code>s at the beginning and end.</p>
  
  <p>I've tried doing <code>"aeiou".chars()</code> but it got pretty ugly and unwieldy from there trying to turn the <code>char</code>s into <code>&amp;str</code>s.</p>
  
  <p>For the time being, I just typed out <code>["a", "e", "i", "o", "u"].iter()</code>, but there's got to be an easier, more idiomatic way.</p>
  
  <p>For context, I'm eventually going to be looping over each value and passing it into something like <code>string.matches(vowel).count()</code>.</p>
  
  <p>Here's my overall code.  Maybe I went astray somewhere else.</p>
  
  <pre><code>fn string_list_item_count&lt;'a, I&gt;(string: &amp;str, list: I) -&gt; usize
  where
      I: IntoIterator&lt;Item = &amp;'a str&gt;,
  {
      let mut num_instances = 0;
  
      for item in list {
          num_instances += string.matches(item).count();
      }
  
      num_instances
  }
  
  // snip
  
  string_list_item_count(string, vec!["a", "e", "i", "o", "u"])
  
  // snip
  </code></pre>
  
  <p>If I could make <code>string_list_item_count</code> accept the <code>std::str::pattern::Pattern</code> trait inside the iterator, I think that would make this function accept iterators of <code>&amp;str</code> and <code>char</code>, but the <code>Pattern</code> trait is a nightly unstable API and I'm trying to avoid using those.</p>