Skip to content

Commit

Permalink
chore(content/til): update "2024_02_07-iter_vs_into__iter"
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 authored Feb 7, 2024
1 parent e776a57 commit 6a4bb87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/til/2024_02_07-iter_vs_into__iter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ So:
`into_iter` is a generic method to obtain an iterator, whether this iterator yields values, immutable references or mutable references **is context dependent** and can sometimes be surprising.

`iter` and `iter_mut` are ad-hoc methods. Their return type is therefore independent of the context, and will conventionally be iterators yielding immutable references and mutable references, respectively.

**ref:** https://stackoverflow.com/a/34745885

0 comments on commit 6a4bb87

Please sign in to comment.