You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Borrow acts similarly to AsRef, with a slight difference being that the former also requires PartialEq, Eq and Hash to work the same for the borrowed type.
This seems to be upheld by JS classes -> superclasses, and as such I'm wondering why this trait isn't implemented for those?
Is it just because most of them don't implement Hash? If that were to change, would it make sense to implement Borrow?
Additional Details
I'm taking inspiration from this crate for a few design decisions for objc2, and would like to know your thoughts on this.
The text was updated successfully, but these errors were encountered:
This seems to be upheld by JS classes -> superclasses, and as such I'm wondering why this trait isn't implemented for those?
I unfortunately don't know the historical context here, but I don't really see a reason why Borrow shouldn't be implemented.
Is it just because most of them don't implement Hash? If that were to change, would it make sense to implement Borrow?
I believe this isn't relevant. Borrow doesn't require Hash, it just requires Hash implementations to have the same output, which is irrelevant in our case as long as we don't implement Hash.
Summary
Borrow
acts similarly toAsRef
, with a slight difference being that the former also requiresPartialEq
,Eq
andHash
to work the same for the borrowed type.This seems to be upheld by JS classes -> superclasses, and as such I'm wondering why this trait isn't implemented for those?
Is it just because most of them don't implement
Hash
? If that were to change, would it make sense to implementBorrow
?Additional Details
I'm taking inspiration from this crate for a few design decisions for
objc2
, and would like to know your thoughts on this.The text was updated successfully, but these errors were encountered: