iter().take(max_len)
I'm working on small project which sends desktop notifications if it finds switch games on sale.
I run Clippy on the code I wrote so far, and Clippy taught me new thing (again! - Clippy is awesome).
Instead, this:
for i in games[..max_len] {
...
games[i].title()
...
}
you can do this:
for game in games.iter().take(max_len) {
...
game.title()
...
}
Thanks for reading! Read other posts?