File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
src/fn/closures/closure_examples Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,15 @@ fn main() {
41
41
println!("2 in vec2: {}", vec2.into_iter().any(|x| x == 2));
42
42
43
43
// `iter()` only borrows `vec1` and its elements, so they can be used again
44
+ // `iter()`は`vec1`とその要素を借用するだけなので、再び利用できる。
44
45
println!("vec1 len: {}", vec1.len());
45
46
println!("First element of vec1 is: {}", vec1[0]);
46
47
// `into_iter()` does move `vec2` and its elements, so they cannot be used again
48
+ // `into_iter()`は`vec2`とその要素をムーブするので、再利用することはできない。
47
49
// println!("First element of vec2 is: {}", vec2[0]);
48
50
// println!("vec2 len: {}", vec2.len());
49
51
// TODO: uncomment two lines above and see compiler errors.
52
+ // TODO: 上の2行をアンコメントしてコンパイルエラーになることを確認
50
53
51
54
let array1 = [1, 2, 3];
52
55
let array2 = [4, 5, 6];
You can’t perform that action at this time.
0 commit comments