title: How to update a char in a String?
body: <p>I'm trying to update a <code>char</code> in a <code>String</code>, but can't seem to be able to do that.  </p>
  
  <pre><code>fn main() {
      let mut s = "poyo".to_string();
      // s[1] = 'i'; or s.get_mut(1) = 'i'; can't do either
      println!("{}", s); // expecting "piyo"
  }
  </code></pre>
  
  <p>I know why this happens (<code>String</code> does not implement <code>IndexMut&lt;usize&gt;</code>), but I don't know how to resolve this...</p>
  
  <p><a href="https://play.rust-lang.org/?gist=188a5cb8ee442958bdca286b3a75a265&amp;version=undefined" rel="nofollow noreferrer">playground link</a></p>