(rnd: u8)
| 93 | } |
| 94 | |
| 95 | fn make_person(rnd: u8) -> Box<dyn Person> { |
| 96 | match rnd { |
| 97 | 0..=3 => Box::new(StreetPerson("Bob".to_string())), |
| 98 | 4..=6 => Box::new(CollegeStudent("Bobby".to_string())), |
| 99 | 7..=9 => Box::new(RustProgrammer("Robert".to_string())), |
| 100 | _ => Box::new(SuperCompSciStudent("Bert".to_string())), |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | fn main() { |
| 105 | let p = make_person(8); |
no test coverage detected