Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
13 additions
and
0 deletions.
-
+13
−0
src/main.rs
|
@@ -129,7 +129,20 @@ fn f_ilter() { |
|
|
} |
|
|
} |
|
|
|
|
|
fn take_5() { |
|
|
let rng = 1..1000_i32; |
|
|
let rng_even_pow3 = rng.filter(|n| *n % 2 == 0) |
|
|
.map(|n| n.pow(3)) // why no ``*`` ? |
|
|
.take(5) // yay |
|
|
.collect::<Vec<i32>>(); |
|
|
#[allow(path_statements)] // what is a path_statement? |
|
|
for _n in rng_even_pow3 { |
|
|
_n; |
|
|
} |
|
|
} |
|
|
|
|
|
fn main() { |
|
|
take_5(); |
|
|
f_ilter(); |
|
|
iter_consumer(); |
|
|
string_iter(); |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.