Grégoire Locqueville on Nostr: What's the conceptual difference between `Iterator` and `IntoIterator`? Like for ...
What's the conceptual difference between `Iterator` and `IntoIterator`?
Like for instance, `Vec` implements `IntoIterator`, which means it may be converted to a type that implements `Iterator`. But what stopped the people who implemented `IntoIterator` for `Vec` to have it directly implement `Iterator`?
#RustLang
Published at
2026-03-31 12:57:33 UTCEvent JSON
{
"id": "125086b5eb9b012e0ae64672eb17e74f9fceba9bba6abcb7f602c735ccabb314",
"pubkey": "da2ffb9942d327b65ee66f152d69a427f114a4a42f69a4d9b88ab9cab96339b9",
"created_at": 1774961853,
"kind": 1,
"tags": [
[
"t",
"rustlang"
],
[
"proxy",
"https://mathstodon.xyz/users/glocq/statuses/116323900039812644",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "What's the conceptual difference between `Iterator` and `IntoIterator`?\n\nLike for instance, `Vec` implements `IntoIterator`, which means it may be converted to a type that implements `Iterator`. But what stopped the people who implemented `IntoIterator` for `Vec` to have it directly implement `Iterator`?\n\n#RustLang",
"sig": "0ff4ba9c65301f88cab1063deb381ff5573f8ea801ef88eba0bb4e15b22e1b6163df3382977ce05f7402a8b6593a533a8aafb85e45a42fbfd32e2e5b842d2494"
}