title: Why does this read input before printing?
body: <p>I'm having some problems with some basic I/O stuff. Specifically, the text "Please enter your name" is written to the output <strong>after</strong> I type in my name and hit <kbd>Enter</kbd>:</p>
  
  <pre><code>use std::io;
  
  fn main() {
      print!("Please enter your name: ");
  
      let mut name = String::new();
      match io::stdin().read_line(&amp;mut name) {
          Ok(_) =&gt; println!(""),
          Err(err) =&gt; println!("Could not parse input: {}", err)
      }
  
      println!("Hello, {}!", name.trim());
  }
  </code></pre>
  
  <p>gives the following output:</p>
  
  <pre class="lang-none prettyprint-override"><code>Compiling chat v0.1.0 (file:///home/marcus/dev/rust/chat)
    Running `target/debug/chat`
  marcus
  Please enter your name: 
  Hello, marcus!
  </code></pre>
  
  <p>Where the first "marcus" was entered by me. Why won't the program print "Please enter your name" before waiting for input?</p>
  
  <hr>
  
  <p>Is it possible to "do nothing" if a returned <code>Result</code> is <code>Ok</code>? In the example, <code>Ok()</code> means that I have saved the input in the variable name. That's great. But what do I do with <code>Ok() =&gt;</code> in this case?</p>