title: Cleaner way to get the contents of a file as string in Rust?
body: <p>As my first dive into Rust in a while, I started writing code to dump the contents of a file to a string, for later processing (right now I'm just printing it out though)</p>
  
  <p>Is there a cleaner way to do this than I currently am? It seems like I'm having to be way too verbose about it, but I'm not seeing any good way to clean it up </p>
  
  <pre><code>use std::io;
  use std::io::File;
  use std::os;
  use std::str;
  
  fn main() {
      println!("meh");
      let filename = &amp;os::args()[1];
      let contents = match File::open(&amp;Path::new(filename)).read_to_end() {
          Ok(s) =&gt; str::from_utf8(s.as_slice()).expect("this shouldn't happen").to_string(),
          Err(e) =&gt; "".to_string(),
      };
      println!("ugh {}", contents.to_string());
  }
  </code></pre>