Skip to content

Commit

Permalink
Merge pull request #436 from cbzehner/gigasecond
Browse files Browse the repository at this point in the history
gigasecond: Update dependency to conform to usage guidelines
  • Loading branch information
coriolinus authored Mar 7, 2018
2 parents ac8f5c6 + e027003 commit 6615150
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions exercises/gigasecond/.meta/hints.md
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.
3 changes: 3 additions & 0 deletions exercises/gigasecond/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


## Rust Installation

Refer to the [exercism help page][help-page] for Rust installation and learning
Expand Down
2 changes: 1 addition & 1 deletion exercises/gigasecond/example.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate chrono;
use chrono::*;
use chrono::{DateTime, Duration, Utc};

pub fn after(start: DateTime<Utc>) -> DateTime<Utc> {
start + Duration::seconds(1_000_000_000)
Expand Down
14 changes: 7 additions & 7 deletions exercises/gigasecond/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate chrono;
use chrono::*;

// 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);
}
2 changes: 1 addition & 1 deletion exercises/gigasecond/tests/gigasecond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern crate gigasecond;
* In order to use the crate, your solution will need to start with the two following lines
*/
extern crate chrono;
use chrono::*;
use chrono::{TimeZone, Utc};

#[test]
fn test_date() {
Expand Down

0 comments on commit 6615150

Please sign in to comment.