Browse Source

chore(readme): format

pull/2475/head
Harry 3 months ago committed by Niccolò Primo
parent
commit
5d15d8071d
  1. 8
      subjects/blood_types/README.md

8
subjects/blood_types/README.md

@ -24,13 +24,15 @@ To provide a simple way to create blood types, implement the trait `FromStr` for
```
Implement the following Traits:
- `std::cmp::Ord`: to make possible to sort a vector or array of `BloodType`.
- `std::Debug`: for `BloodType`, allowing us print a vector such as `[BloodType { antigen: A, rh_factor: Positive}, BloodType{ antigen: B, rh_factor: Negative}]` as `"[ A+, B-]"` when using format strings `{:?}`.
Create three methods for BloodType:
- `can_receive_from`: which returns `true` if `self` can receive blood from `other` blood type.
- `donors`: which returns all the blood types that can give blood to `self`.
- `recipients`: which returns all the blood types that can receive blood from `self`.
- `can_receive_from`: which returns `true` if `self` can receive blood from `other` blood type.
- `donors`: which returns all the blood types that can give blood to `self`.
- `recipients`: which returns all the blood types that can receive blood from `self`.
### Expected Functions and Structures

Loading…
Cancel
Save