title: How do I change from as_slice() to [] syntax?
body: <p>Recompiling some older code against the newer nightlies, I'm getting warnings on using the <code>as_slice()</code> syntax in favour of the <code>var[]</code> syntax.</p>
  
  <p>However when I replace <code>as_slice()</code> with <code>[]</code> as shown <a href="https://github.com/rust-lang/rfcs/blob/master/text/0198-slice-notation.md" rel="nofollow">in the RFC</a>, I get a compiler error saying:</p>
  
  <pre><code> expected `&amp;str`,
      found `str`
  (expected &amp;-ptr,
      found str) [E0308]
  src/main.rs:38         print_usage(program[], opts);
  </code></pre>
  
  <p>compared to my original</p>
  
  <pre><code>print_usage(program.as_slice(), opts);
  </code></pre>
  
  <p>Is the <code>as_slice()</code> syntax going away entirely, or is it just more idiomatic to write it as <code>vec[]</code>? What's the deal with the error I'm getting when I follow what the compiler is asking me to do?</p>