News for hackers. Stuff that matters.
Re:“Python's batteries are leaking” by nicoburns on Saturday May 18, 2019 @03:00PM (#19949102)
Re:“Python's batteries are leaking” by StavrosK on Saturday May 18, 2019 @03:55PM (#19949398)
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).
Re:“Python's batteries are leaking” by edflsafoiewq on Saturday May 18, 2019 @04:28PM (#19949559)

    use std::iter::FromIterator;
    BTreeMap::from_iter(hash_map.into_iter())
Re:“Python's batteries are leaking” by steveklabnik on Saturday May 18, 2019 @05:54PM (#19949946)
Or .into_iter().collect(), I believe. No import needed.
Re:“Python's batteries are leaking” by a1369209993 on Saturday May 18, 2019 @06:12PM (#19950017)
Assuming the keys are Hash + Ord, wouldn't that just be:

  for (k,v) in &src
    { dst.insert(k,v); }

?
Re:“Python's batteries are leaking” by StavrosK on Sunday May 19, 2019 @01:26PM (#19954362)
Yes, 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.
Re:“Python's batteries are leaking” by new4thaccount on Saturday May 18, 2019 @03:46PM (#19949355)
At least the first one seems pretty straightforward and thanks for replying. I only just started and have a lot to learn.
Re:“Python's batteries are leaking” by qbaqbaqba on Sunday May 19, 2019 @02:35AM (#19951808)
Are they compatible?