-
Notifications
You must be signed in to change notification settings - Fork 185
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
Create a new type MinutesSinceEpoch to replace i32 in MetaZonePeriodV1 #2355
base: main
Are you sure you want to change the base?
Conversation
|
||
pub(crate) struct DeserializeMinutesSinceEpochString; | ||
|
||
impl<'de> serde::de::Visitor<'de> for DeserializeMinutesSinceEpochString { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some errors complaining like failed to resolve: use of undeclared crate or module
de`` or cannot find Deserialize
.
I tried to use sth like use ::serde::{de, Deserialize, Deserializer};
from other examples, but had no luck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the annotation #[cfg(feature = "serde")]
where | ||
S: serde::Serializer, | ||
{ | ||
let string = DateTime::from_minutes_since_local_unix_epoch(26382240)?.to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like there is no to_string
for DateTime
. Should I construct the string by myself here?
We are now considering this blocked on #2127 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocked on #2127
Create a new type like MinutesSinceEpoch to replace i32 in MetaZonePeriodV1 (#2155)