title: Why can I call File::open(...).read_to_end()?
body: <p>The following code works and I don't know why:</p>
  
  <pre><code>File::open(&amp;some_path).read_to_end().unwrap();
  </code></pre>
  
  <p>Looking at the API docs I can see <code>File::open()</code> returning a <a href="http://doc.rust-lang.org/std/io/type.IoResult.html"><code>IoResult</code></a> which does not have a <code>read_to_end()</code>.</p>
  
  <p>Is there some kind of syntax sugar going on? Does <code>Result&lt;T, Error&gt;</code> somehow turn into <code>Result&lt;U, Error&gt;</code>?</p>
  
  <p>Documentation: <a href="http://doc.rust-lang.org/std/io/fs/struct.File.html#method.read_to_end">http://doc.rust-lang.org/std/io/fs/struct.File.html#method.read_to_end</a></p>