Skip to content

Instantly share code, notes, and snippets.

@larsbergstrom
Created November 7, 2013 19:13
Show Gist options
  • Save larsbergstrom/7360256 to your computer and use it in GitHub Desktop.
Save larsbergstrom/7360256 to your computer and use it in GitHub Desktop.
struct Point {x: f64, y: f64}
fn get_x_sh_good<'r>(p: &'r Point) -> &'r f64 {
&p.x
}
fn test2() {
let s = @Point{x:1.0, y:2.0};
let new_x = get_x_sh_good(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment