mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
568 B
19 lines
568 B
use blood_types_s::{Antigen, BloodType, RhFactor}; |
|
|
|
fn main() { |
|
let blood_type = BloodType { |
|
antigen: Antigen::O, |
|
rh_factor: RhFactor::Positive, |
|
}; |
|
println!("recipients of O+ {:?}", blood_type.recipients()); |
|
println!("donors of O+ {:?}", blood_type.donors()); |
|
let another_blood_type = BloodType { |
|
antigen: Antigen::O, |
|
rh_factor: RhFactor::Positive, |
|
}; |
|
println!( |
|
"donors of O+ can receive from {:?} {:?}", |
|
&another_blood_type, |
|
blood_type.can_receive_from(&another_blood_type) |
|
); |
|
}
|
|
|