-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Hash trait on FixedOffset #254
Conversation
This PR doesn't actually add a What is |
I guess that this is an attempt to conform with the C-COMMON-TRAITS guideline. This is so that users can rely on these traits (regardless of semantics, e.g. as BTreeMap key) without having to create newtypes. But you're right, since the fixed offset timezone can be interpreted as having a cyclic ordering, deriving |
Thanks that's a good point. I would like to have Ord and if we can't have it we should document why it isn't there. I'd like to have a solid understanding of what the use-cases are -- as is, sticking a TZ into a BTreeMap would probably lead to surprising behavior? If we're going to add it we should not derive it, we should do a separate impl so that we can add doc-comments about the actual behavior. Also, I forgot to say: thanks for the PR @LuoZijun! |
I am using #[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub struct Datetime {
Utc: NaiveDateTime,
Offset: FixedOffset,
} In the interpreter implementation, I need to store this structure in a HashMap (@Enet4 is right), so I need to implement the But currently our For some language reasons (I do not speak english), I'm sorry I didn't specify this on the PR From Google Translate |
Thanks for the explanation! Google translate is fantastic. For just a HashMap you shouldn't need If you still want |
Updated. |
No description provided.