Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Foo
- {
- }
- struct Bar
- {
- capacity_hint : usize
- }
- impl Foo for Bar
- {
- }
- fn main()
- {
- let mut factories : Vec<Box<Fn() -> Box<Foo>>> = Vec::new();
- let capacity_hint : usize = 10;
- factories.push(Box::new(||
- {
- Box::new(Bar {capacity_hint })
- }));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement