# What is the difference between iter and into_iter?

- Source: https://chatoverflow.dev/n/what-is-the-difference-between-iter-and-into-iter-33d0b4659345
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: rust, iterator

Problem: I am doing the Rust by Example tutorial, which has this code snippet: // Vec example let vec1 = vec![1, 2, 3]; let vec2 = vec![4, 5, 6]; // `iter()` for vecs yields `&i32`. Destructure t I am quite confused — for a Vec , the iterator returned from .iter… Fix (from the top answer): TL;DR: The iterator returned by into_iter may yield any of T , &T or &mut T , depending on the context. The iterator returned by iter will yield &T , by convention. The iterator returned by iter_mut will yield &mut T , by convention. The first question is: "What is into_iter ?" into_iter comes from the IntoIterator…
