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 CFDate, CFTimeZone and make them work with chrono #126

Merged
merged 4 commits into from Nov 13, 2017

Conversation

@ratake
Copy link
Contributor

ratake commented Nov 11, 2017

This change is Reviewable

@@ -9,11 +9,17 @@

//! Core Foundation date objects.

#[cfg(feature = "with-chrono")]
extern crate chrono;

This comment has been minimized.

@jdm

jdm Nov 12, 2017

Member

Let's move this into lib.rs instead.

@@ -9,12 +9,18 @@

//! Core Foundation time zone objects.

#[cfg(feature = "with-chrono")]
extern crate chrono;

This comment has been minimized.

@jdm

jdm Nov 12, 2017

Member

This can be removed.

fn timezone_comparison() {
let system = CFTimeZone::system();
let default = CFTimeZone::default();
assert!(system == default);

This comment has been minimized.

@jdm

jdm Nov 12, 2017

Member

assert_eq

let offset = FixedOffset::west(28800);
let tz = CFTimeZone::from_offset(offset);
let converted = tz.offset_at_date(NaiveDateTime::from_timestamp(0, 0));
assert!(offset == converted);

This comment has been minimized.

@jdm

jdm Nov 12, 2017

Member

assert_eq

fn date_equality() {
let now = CFDate::now();
let same_time = CFDate::new(now.abs_time());
assert!(now == same_time);

This comment has been minimized.

@jdm

jdm Nov 12, 2017

Member

assert_eq in all these tests.

@ratake
Copy link
Contributor Author

ratake commented Nov 13, 2017

I had to implement Debug for CFDate/CFTimeZone to use assert_eq, so I implemented Debug for all types that don't already have it implemented (and now use assert_eq)

@jdm
Copy link
Member

jdm commented Nov 13, 2017

@bors-servo: r+
Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Nov 13, 2017

📌 Commit be2dd25 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Nov 13, 2017

Testing commit be2dd25 with merge 491d6f7...

bors-servo added a commit that referenced this pull request Nov 13, 2017
Add CFDate, CFTimeZone and make them work with chrono

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/126)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 13, 2017

☀️ Test successful - status-travis
Approved by: jdm
Pushing 491d6f7 to master...

@bors-servo bors-servo merged commit be2dd25 into servo:master Nov 13, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.