For everything below, cloned
could also be copied
.
You can't use Iterator::cloned
with the iterators from maps because their items are (&K, &V)
rather than &Something
. Could we add iter_cloned
to HashMap
and BTreeMap
for this use-case?