Created
June 23, 2013 11:45
-
-
Save rubber-duck/5844737 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Foo<'self> | |
{ | |
foo: &'self fn() | |
} | |
impl<'self> Foo<'self> { | |
fn foo(&self) { | |
println("Method foo"); | |
} | |
} | |
fn main() { | |
let f = Foo { foo: || { println("Fn foo"); } }; | |
let ff = f.foo; | |
f.foo(); | |
ff(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment