4 ms·
Oof, I wasted a good hour+ trying to convert from one to the other. Maybe there's an easy way to do this, but not many people on IRC knew (or were available at
by StavrosK 8y ago
Oof, I wasted a good hour+ trying to convert from one to the other. Maybe there's an easy way to do this, but not many people on IRC knew (or were available at the time).
- edflsafoiewq 8y agouse std::iter::FromIterator; BTreeMap::from_iter(hash_map.into_iter())
- steveklabnik 8y agoOr .into_iter().collect(), I believe. No import needed.
- a1369209993 8y agoAssuming the keys are Hash + Ord, wouldn't that just be: for (k,v) in &src { dst.insert(k,v); } ?
- StavrosK 7y agoYes, that's what I ended up doing, but the error confused me and I ended up looking for a less hacky way for more than an hour until I said "fuck it" and just did that.