-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(index): Apply feedback from Cargo team #16369
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
Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use |
|
|
|
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.
Thanks!
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.
Thanks! ![]()
| /// In ISO8601 with UTC timezone (e.g. 2025-11-12T19:30:12Z) | ||
| pub pubtime: Option<String>, | ||
| #[cfg_attr(feature = "unstable-schema", schemars(with = "Option<String>"))] | ||
| pub pubtime: Option<jiff::Timestamp>, |
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.
Do we intend to expose the concrete jiff::Timestamp to users? Should we wrap it with our own type?
(Similar discussion in #15293 (comment). I am fine with either)
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.
My comment from that thread
Yes and we already had this problem with
timein the puiblic API. I was just wondering if we should consolidate the breaking changes or going ahead and moving forward. No strong opinion. So long as the serialization format is unchanged, breaking changes to this API are not too big of a deal; the target audience is very small.
Just adding a field is a breaking change so not to worried and adding a custom type seems like boiler plate with little benefit
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.
Thanks. Just want to make sure this is intentional. Also cargo-util-schemas is a package we are not worried about bumping version.
|
|
||
| pub fn parse_pubtime(s: &str) -> Result<jiff::Timestamp, jiff::Error> { | ||
| let dt = jiff::civil::DateTime::strptime("%Y-%m-%dT%H:%M:%SZ", s)?; | ||
| if s.len() == 20 { |
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.
Cargo isn't future-proof for years beyond 9999 😆
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.
I hope it can last that long! Perhaps this code still is buried in the Arctic mountain at that time🤣
What does this PR try to resolve?
Questions from #16270
Through the conversation, it also came up that we should be very explicit that
pubtimeis only for publish time and not updates likeyankedHow to test and review this PR?