Kimundi / owning-ref-rs

A library for creating references that carry their owner with them.
MIT License
362 stars 50 forks source link

Implement `PartialEq` etc. #6

Closed dpc closed 8 years ago

dpc commented 8 years ago

I'm not sure if it's a good idea, but it seems to me that OwningRef could implement PartialEq, Eq etc. that just do it on T itself.

milancio42 commented 8 years ago

IMHO it's a good idea. I need to put OwningRef into HashMap, but currently I cannot, since Hash is a foreign trait and OwningRef is a foreign type. I would need to wrap it into my type, but that is just not ergonomic, since I would need to re-implement all the necessary methods from OwningRef. The implementation should be trivial - I can prepare the PR (Eq, PartialEq, Ord, PartialOrd and Hash) if the owner agrees.

waywardmonkeys commented 8 years ago

This was resolved when #7 was landed, right?

meh commented 8 years ago

Yes, this can be closed.