Skip to content

Instantly share code, notes, and snippets.

@warmwaffles
Created March 3, 2017 03:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warmwaffles/51bf12c1481a1cd5a7df5797e247907f to your computer and use it in GitHub Desktop.
Save warmwaffles/51bf12c1481a1cd5a7df5797e247907f to your computer and use it in GitHub Desktop.
fn get_id(req: &mut Request) -> Option<Uuid> {
let param = req.extensions.get::<Router>().unwrap().find("id");
match param {
Some(x) => Some(Uuid::parse_str(param.unwrap()).unwrap()),
None => None
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment