|
|
|
|
|
by davidhyde
2424 days ago
|
|
You can use iterators to avoid unnecessary bounds checking on every element in a slice and you can still get an index to the value. Something like this: ```
for (i, val) in my_slice.iter().enumerate() {
let x = *val + 9999;
}
``` |
|