Skip to content

Instantly share code, notes, and snippets.

@tioover
Created January 19, 2015 13:03
Show Gist options
  • Save tioover/57bcad218c4ca094d557 to your computer and use it in GitHub Desktop.
Save tioover/57bcad218c4ca094d557 to your computer and use it in GitHub Desktop.
use std::boxed::Box;
struct X;
struct A {x: Option<Box<X>>}
fn main() {
let mut a = Box::new(A{x: Some(Box::new(X))});
let mut b = &mut a;
let mut c = b.x.take();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment