Skip to content

Instantly share code, notes, and snippets.

@muja
Created August 2, 2015 23:00
Show Gist options
  • Save muja/7433c9e104549e0356a3 to your computer and use it in GitHub Desktop.
Save muja/7433c9e104549e0356a3 to your computer and use it in GitHub Desktop.
// HAVE:
let dest = if let Some(ref p) = self.destination {
p.as_ptr() as *const _
} else {
0 as *const _
};
// WANT:
self.destination.map(|x| x.as_ptr() as *const _).unwrap_or(0 as *const _)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment