title: What is the idiomatic way to convert a String to &str?
body: <p>I've found a number of ways to convert <code>String</code> to <code>&amp;str</code>. Which one is correct/idiomatic today?</p>
  
  <pre><code>let string = "hello".to_string();
  
  let string_slice1 = &amp;string[..];
  let string_slice2: &amp;str = &amp;string;
  let string_slice3 = &amp;*string;
  </code></pre>
  
  <p>How would I make the second method work without specifying type in variable declaration? Something like <code>&amp;string as &amp;str</code> (but it doesn't work). I see that <code>&amp;string</code> has <code>&amp;String</code> type but when it is implicitly cast to <code>&amp;str</code>, it will perform implicit conversion. How do I make that conversion explicit?</p>