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
I think NaiveDate can be reasonably used as a hash key. For other types, uh, I don't think they work. Can I ask you for the use case? (And sorry for delay!)
No problem! I didn't notice that NaiveDate worked; I was using Date<Local>. The main reason why it'd be nice to have is that I use Date<Local> and DateTime<Local> for all the times I parse from a user, and it seemed confusing that I need to call .naive_*() in order to use them as hash keys, because if I were to match the key, I'd have to re-cast them back into Locals, which might be ambiguous.
I think it'd be suitable if the Hash implementation just called .naive_date().hash() and ignored the time zone parts.
It'd be nice to offer
Hash
implementations for all of the date/time structs so that they can be used as keys inHashMap
s.The text was updated successfully, but these errors were encountered: