Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let mut cars = Vec::new() as Vec<Box<Drive>>;
- cars.push(Box::new(Toyota));
- cars.push(Box::new(Honda));
- cars.push(Box::new(Ford));
- for c in &cars {
- c.drive();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement