Skip to content
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 example to rfc3339's docs #391

Merged
merged 3 commits into from
Nov 11, 2021
Merged

Add example to rfc3339's docs #391

merged 3 commits into from
Nov 11, 2021

Conversation

Shadlock0133
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Nov 9, 2021

Codecov Report

Merging #391 (b8c5b5d) into main (be29bb3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #391   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files          52       52           
  Lines        5574     5574           
=======================================
  Hits         5557     5557           
  Misses         17       17           
Impacted Files Coverage Δ
src/format_description/mod.rs 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be29bb3...b8c5b5d. Read the comment docs.

@jhpratt
Copy link
Member

jhpratt commented Nov 9, 2021

If we're going to add an example, why not have it be actual code showing how it's used?

@jhpratt jhpratt added A-docs Area: documentation A-format-description Area: format description C-enhancement Category: an enhancement with existing code labels Nov 9, 2021
@Shadlock0133
Copy link
Contributor Author

Shadlock0133 commented Nov 10, 2021

Rfc3339 is a struct representing a format description, so I would expect an example of the format, and maybe a format description string?
I think code examples makes sense on parse/format functions, which already have them. But maybe Rfc3339 could have links, like:

/// The format described in [RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6).
///
/// Format description: "[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond]Z"
///
/// Example: 1985-04-12T23:20:50.52Z
///
/// Can be used with `parse` and `format` functions of [`Time`], [`Date`], ...
pub struct Rfc3339;

@jhpratt
Copy link
Member

jhpratt commented Nov 10, 2021

Perhaps having some sort of indication that it can be passed to those methods is what I was envisioning. One thing we don't want, though, is the "[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond]Z" comment — it's not accurate as there are nuances that make it different.

@jhpratt
Copy link
Member

jhpratt commented Nov 11, 2021

LGTM. Thanks.

@jhpratt jhpratt merged commit fff7f80 into time-rs:main Nov 11, 2021
@Shadlock0133 Shadlock0133 deleted the patch-1 branch November 11, 2021 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation A-format-description Area: format description C-enhancement Category: an enhancement with existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants