Skip to content

Fix compliance with Atom specification #588

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

Merged
merged 2 commits into from
May 12, 2020
Merged

Fix compliance with Atom specification #588

merged 2 commits into from
May 12, 2020

Conversation

ilpianista
Copy link
Contributor

With commit db0164f the code that generates the atom:updated element has been changed from time::now_utc().rfc3339().to_string() to chrono::Utc::now().to_rfc3339(), but unfortunately the latter isn't a replacement of the first because it includes the nanoseconds in its output:

2009-02-13T15:31:30-08:00 (time)
2020-05-12T14:24:08.866226229+00:00 (chrono)

The Atom specification defines the updated element of type xsd:dateTime which doesn't include the nanoseconds.

I discovered this by using feed-io to parse your Atom feed.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@ilpianista ilpianista changed the title Fix complicance with Atom specification Fix compliance with Atom specification May 12, 2020
@@ -185,7 +185,7 @@ impl<'a> Generator<'a> {
.collect();
let data = Releases {
releases: releases,
feed_updated: chrono::Utc::now().to_rfc3339(),
feed_updated: chrono::Utc::now().with_nanosecond(0).unwrap().to_rfc3339(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there's no need to change this, but I thought it was OK to keep them aligned.

@XAMPPRocky
Copy link
Member

Thank you for your PR, and congrats on your first contribution! 🎉

@XAMPPRocky XAMPPRocky merged commit 17c8dcc into rust-lang:master May 12, 2020
jackh726 pushed a commit to jackh726/blog.rust-lang.org that referenced this pull request Jul 26, 2021
* Remove nanoseconds from atom:updated element

* Add missing import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants