Skip to content

Commit 596b7df

Browse files
admwrdAdam W
authored and
Adam W
committed
Update new_types.md wording
* Reword example code from "old enough" to "is an adult". * Use 25 years old, not 5 years old.
1 parent 57f1e70 commit 596b7df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/generics/new_types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ impl Days {
2525
}
2626
}
2727
28-
fn old_enough(age: &Years) -> bool {
28+
fn is_adult(age: &Years) -> bool {
2929
age.0 >= 18
3030
}
3131
3232
fn main() {
33-
let age = Years(5);
33+
let age = Years(25);
3434
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));
35+
println!("Is an adult? {}", is_adult(&age));
36+
println!("Is an adult? {}", is_adult(&age_days.to_years()));
37+
// println!("Is an adult? {}", is_adult(&age_days));
3838
}
3939
```
4040

0 commit comments

Comments
 (0)