We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 57f1e70 + 596b7df commit 7c07defCopy full SHA for 7c07def
src/generics/new_types.md
@@ -25,16 +25,16 @@ impl Days {
25
}
26
27
28
-fn old_enough(age: &Years) -> bool {
+fn is_adult(age: &Years) -> bool {
29
age.0 >= 18
30
31
32
fn main() {
33
- let age = Years(5);
+ let age = Years(25);
34
let age_days = age.to_days();
35
- println!("Old enough {}", old_enough(&age));
36
- println!("Old enough {}", old_enough(&age_days.to_years()));
37
- // println!("Old enough {}", old_enough(&age_days));
+ println!("Is an adult? {}", is_adult(&age));
+ println!("Is an adult? {}", is_adult(&age_days.to_years()));
+ // println!("Is an adult? {}", is_adult(&age_days));
38
39
```
40
0 commit comments