title: How do I convert a String to an integer in Rust?
body: <p>Reading input from stdin produces a <code>String</code>, but how do I convert it to an integer? </p>
  
  <pre><code>use std::io;
  
  fn main() {
      println!("Type something");
  
      let mut input = String::new();
  
      io::stdin()
          .read_line(&amp;mut input)
          .expect("Failed to read line");
  
      println!("{}", input);
  }
  </code></pre>