-
Notifications
You must be signed in to change notification settings - Fork 520
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
gigasecond: Update dependency to conform to usage guidelines #436
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
If you're unsure what operations you can perform on `DateTime<Utc>` take a look at the [chrono crate](https://docs.rs/chrono/0.4.0/chrono/) which is listed as a dependency in the `Cargo.toml` file for this exercise. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ Calculate the moment when someone has lived for 10^9 seconds. | |
|
||
A gigasecond is 10^9 (1,000,000,000) seconds. | ||
|
||
If you're unsure what operations you can perform on `DateTime<Utc>` take a look at the [chrono crate](https://docs.rs/chrono/0.4.0/chrono/) which is listed as a dependency in the `Cargo.toml` file for this exercise. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still a bit concerned this isn't a clear enough hint to walk users to adding
It implies to me as a beginner in Rust that I should be doing the same thing Duration doesn't appear in reexports and the function most people end up using for this exercise Do y'all have any suggestions on how to help this hint provide a bit more structured guidance for people new to the Cargo ecosystem? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I see what you mean because there's a big dedicated section about durations being from I don't have any definitive answers, but how about some ideas?
|
||
|
||
|
||
## Rust Installation | ||
|
||
Refer to the [exercism help page][help-page] for Rust installation and learning | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
extern crate chrono; | ||
use chrono::*; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree that we should remove the glob import as bad style, but I think we can do better. What about: use chrono::{DateTime, Duration}; This way we don't have to mess with a second dependency or globs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies both to the lib stub and the example. |
||
// Returns a Utc DateTime one billion seconds after start. | ||
pub fn after(start: DateTime<Utc>) -> DateTime<Utc> { | ||
unimplemented!() | ||
} | ||
extern crate chrono; | ||
use chrono::{DateTime, Utc}; | ||
|
||
// Returns a Utc DateTime one billion seconds after start. | ||
pub fn after(start: DateTime<Utc>) -> DateTime<Utc> { | ||
unimplemented!("What time is a gigasecond later than {}", start); | ||
} |
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 wasn't sure if there was a specific format for
.meta/hints.md
files. I looked at a couple exercism repos on Github but didn't see any. Let me know if this is alright.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's no specific format necessary there; it's all just human-readable text.
You will, however, need to regenerate the README for this to pass CI:
bin/configlet generate . --only gigasecond
to regenerate the readmeThere 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 for the guidance. I just updated the README.