diff --git a/src/unsafe/calling-unsafe-functions.md b/src/unsafe/calling-unsafe-functions.md index 6c0bc920..7400dc9f 100644 --- a/src/unsafe/calling-unsafe-functions.md +++ b/src/unsafe/calling-unsafe-functions.md @@ -23,6 +23,6 @@ fn main() { } fn count_chars(s: &str) -> usize { - s.chars().map(|_| 1).sum() + s.chars().count() } ```