IntoIterator and reference
The Rust Programming Language Forum
IntoIterator and reference
Hello, I have two codes: for item in ITEMS { ... } for &item in ITEMS { ... } ITEMS is: const ITEMS: &[&str] = &["ITEM_1", "ITEM_2"]; In the first code item is &&str and in the second code &item is &str. With a reference (second code with &item) it can be seen as a tuple. The array can be seen as "unpack" I suppose (as to unpack a tuple) ? And &item is the reference of each element in the array (so &str) ? Can the explanation be found here ? Thank you very much in advance for ...
0 comments
No comments yet.