Skip to content

Commit

Permalink
Merge pull request #1823 from admwrd/new-type-rewording
Browse files Browse the repository at this point in the history
Update new_types.md wording
  • Loading branch information
marioidival authored Feb 26, 2024
2 parents 57f1e70 + 596b7df commit 7c07def
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/generics/new_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ impl Days {
}
}
fn old_enough(age: &Years) -> bool {
fn is_adult(age: &Years) -> bool {
age.0 >= 18
}
fn main() {
let age = Years(5);
let age = Years(25);
let age_days = age.to_days();
println!("Old enough {}", old_enough(&age));
println!("Old enough {}", old_enough(&age_days.to_years()));
// 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));
}
```

Expand Down

0 comments on commit 7c07def

Please sign in to comment.