title: Cannot borrow captured outer variable in an `Fn` closure as mutable
body: <p>This is my first day with Rust, but I'm trying to do something trivial, and I'm stuck. </p>
  
  <p>What I'm trying to do is to add an struct to a Vector, and return the result. What I'm trying is to create a very simple REST service which will store the data in memory when posting, and return all the data in JSON format when doing a GET.</p>
  
  <p>This is my current code:</p>
  
  <pre><code>fn main() {
      let mut server = Nickel::new();
      let mut reservations = Vec::new();
  
     server.post("/reservations/", middleware! { |request, response|
          let reservation = request.json_as::&lt;Reservation&gt;().unwrap();
  
          reservations.push(reservation); // &lt;-- error occurs here
  
          format!("Hello {} {}", reservation.name, reservation.email)
  
      });
  
      server.listen("127.0.0.1:3000");
  }
  </code></pre>
  
  <p>I tried <a href="https://stackoverflow.com/questions/28521637/how-can-i-move-a-captured-variable-into-a-closure-within-a-closure">this solution</a> with a RefCell, but then I get the error that the trait Sync is not implemented for <code>Vec&lt;reservation::Reservation&gt;</code></p>