Guest User

Untitled

a guest
Jun 19th, 2016
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. What I have:
  3. let mut multipart = match Multipart::from_request(req) {
  4. Ok(x) => x,
  5. Err(e) => return Err(NickelError::new(res, "Expected multipart encoding", StatusCode::BadRequest)),
  6. };
  7.  
  8. What I would like:
  9. let mut multipart = try!(Multipart::from_request(req).map_err(|_| (res, StatusCode::BadRequest)));
  10.  
  11. But this is not possible because the closure takes ownership of res, so I cannot use it anywhere after that.
RAW Paste Data