Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo fix in hof.md #463

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rust-by-example-ru/src/fn/hof.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ fn main() {
// Функциональный подход
let sum_of_squared_odd_numbers: u32 =
(0..).map(|n| n * n) // Все натуральные числа возводим в квадрат
.take_while(||&n_squared| n_squared < upper) // Берём те, что ниже верхнего предела
.filter(&n_squared| is_odd(n_squared)) // Выбираем нечётные
.take_while(|&n_squared| n_squared < upper) // Берём те, что ниже верхнего предела
.filter(|&n_squared| is_odd(n_squared)) // Выбираем нечётные
.sum(); // Складываем
println!("функциональный стиль: {}", sum_of_squared_odd_numbers);
}
Expand All @@ -43,4 +43,4 @@ fn main() {


[Option]: https://doc.rust-lang.org/core/option/enum.Option.html
[Iterator]: https://doc.rust-lang.org/core/iter/trait.Iterator.html
[Iterator]: https://doc.rust-lang.org/core/iter/trait.Iterator.html
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't touch this line. I'm not sure why it is marked as changed.