-
Notifications
You must be signed in to change notification settings - Fork 532
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
Slightly improve serde documentation #1519
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1519 +/- ##
=======================================
Coverage 91.81% 91.81%
=======================================
Files 40 40
Lines 18351 18355 +4
=======================================
+ Hits 16849 16853 +4
Misses 1502 1502 ☔ View full report in Codecov by Sentry. |
No clue yet why a warning shows up for the
|
Seems to be a bug in the error reporting of rustdoc. The redundant target was in |
src/datetime/serde.rs
Outdated
@@ -23,10 +23,9 @@ pub struct MicroSecondsTimestampVisitor; | |||
#[derive(Debug)] | |||
pub struct MilliSecondsTimestampVisitor; | |||
|
|||
/// Serialize into an ISO 8601 formatted string. | |||
/// Serialize into an ISO 8601 formatted string, with a format similar to RFC 3339. |
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.
This seems weirdly imprecise, and its precision doesn't match the string used for expecting()
.
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.
It is the RFC 3339 format with the addition that it can (de)serialize datetimes outside the 0..=9999
years range using the ISO 8601 syntax. I'll try to word it better.
src/datetime/serde.rs
Outdated
@@ -65,13 +64,9 @@ impl<'de> de::Visitor<'de> for DateTimeVisitor { | |||
} | |||
} | |||
|
|||
/// Deserialize a value that optionally includes a timezone offset in its | |||
/// string representation | |||
/// Deserialize an RFC 3339 formatted string into a `DateTime<FixedOffset>`. |
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.
FWIW, it's somewhat on purpose that the first line of docstrings doesn't have a .
. These are sentence fragments, not full sentences.
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.
Really? Okay.
Fixes #1484.