Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let mut vec = vec![1, 2, 3];
- for element in vec.iter_mut() {
- *element = (*element) * (*element);
- }
- assert_eq!(vec[0], 1);
- assert_eq!(vec[1], 4);
- assert_eq!(vec[2], 9);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement