Created
February 9, 2013 03:32
-
-
Save alexcrichton/4743714 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use core::hashmap::linear::LinearSet; | |
struct Foo { | |
n: LinearSet<int>, | |
} | |
impl Foo { | |
fn foo(&mut self, fun: fn(&int)) { | |
for self.n.each |f| { | |
fun(f); | |
} | |
} | |
} | |
fn bar(f: &mut Foo) { | |
do f.foo |a| { | |
f.n.insert(*a); | |
} | |
} | |
fn main() { | |
let mut f = Foo { n: LinearSet::new() }; | |
bar(&mut f); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment