Skip to content

Commit 6940925

Browse files
Remove remaining chrono code. (#682)
In 9721646, the `with-chrono` feature was removed, but this dead code lingered.
1 parent c2cca87 commit 6940925

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

core-foundation/src/timezone.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ use crate::base::TCFType;
1616
use crate::date::{CFDate, CFTimeInterval};
1717
use crate::string::CFString;
1818

19-
#[cfg(feature = "with-chrono")]
20-
use chrono::{FixedOffset, NaiveDateTime};
21-
2219
declare_TCFType! {
2320
/// A time zone.
2421
CFTimeZone, CFTimeZoneRef
@@ -56,17 +53,6 @@ impl CFTimeZone {
5653
unsafe { CFTimeZoneGetSecondsFromGMT(self.0, date.abs_time()) }
5754
}
5855

59-
#[cfg(feature = "with-chrono")]
60-
pub fn offset_at_date(&self, date: NaiveDateTime) -> FixedOffset {
61-
let date = CFDate::from_naive_utc(date);
62-
FixedOffset::east(self.seconds_from_gmt(date) as i32)
63-
}
64-
65-
#[cfg(feature = "with-chrono")]
66-
pub fn from_offset(offset: FixedOffset) -> CFTimeZone {
67-
CFTimeZone::new(offset.local_minus_utc() as f64)
68-
}
69-
7056
/// The timezone database ID that identifies the time zone. E.g. `"America/Los_Angeles" `or
7157
/// `"Europe/Paris"`.
7258
pub fn name(&self) -> CFString {
@@ -78,22 +64,10 @@ impl CFTimeZone {
7864
mod test {
7965
use super::CFTimeZone;
8066

81-
#[cfg(feature = "with-chrono")]
82-
use chrono::{FixedOffset, NaiveDateTime};
83-
8467
#[test]
8568
fn timezone_comparison() {
8669
let system = CFTimeZone::system();
8770
let default = CFTimeZone::default();
8871
assert_eq!(system, default);
8972
}
90-
91-
#[test]
92-
#[cfg(feature = "with-chrono")]
93-
fn timezone_chrono_conversion() {
94-
let offset = FixedOffset::west(28800);
95-
let tz = CFTimeZone::from_offset(offset);
96-
let converted = tz.offset_at_date(NaiveDateTime::from_timestamp(0, 0));
97-
assert_eq!(offset, converted);
98-
}
9973
}

0 commit comments

Comments
 (0)