kyren / gc-arena

Incremental garbage collection from safe Rust
Creative Commons Zero v1.0 Universal
436 stars 36 forks source link

Implement Eq, PartialEq, Ord, PartialOrd and Hash for Gc<T> #75

Closed Phantomical closed 1 year ago

Phantomical commented 1 year ago

This implements the above traits for Gc<T> when T implements them. I have tried to model the trait impls after how std implements them for Rc<T>. There are probably more traits that could be added here. I didn't look too hard at the impls list for Rc and just implemented the few that seemed the most useful.

My use case for this is that I would like to use Gc<Path> as keys in a hashmap.

kyren commented 1 year ago

LGTM, thank you!