News for hackers. Stuff that matters.
Re:A Rust Shaped Hole by steveklabnik on Thursday July 17, 2025 @02:04PM (#44596212)
> Also - why would Rust only have a max-heap? In the library I ported, the authors had to reverse the algorithmic logic in the entire library for this.

All you have to do is use a small wrapper type and you get a min heap https://doc.rust-lang.org/std/collections/struct.BinaryHeap....

Re:A Rust Shaped Hole by willtemperley on Thursday July 17, 2025 @07:08PM (#44599315)
Which shows that Rust devs care very little for ergonomics.
Re:A Rust Shaped Hole by steveklabnik on Thursday July 17, 2025 @08:26PM (#44599859)
Depending on how you define “ergonomics,” I guess. I think only needing to provide a comparison function is pretty elegant, rather than duplicating the data structure. YMMV.