Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6940925

Browse files
Remove remainingchrono code. (#682)
In9721646, the `with-chrono`feature was removed, but this dead code lingered.
1 parentc2cca87 commit6940925

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
usecrate::date::{CFDate,CFTimeInterval};
1717
usecrate::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-
pubfnoffset_at_date(&self,date:NaiveDateTime) ->FixedOffset{
61-
let date =CFDate::from_naive_utc(date);
62-
FixedOffset::east(self.seconds_from_gmt(date)asi32)
63-
}
64-
65-
#[cfg(feature ="with-chrono")]
66-
pubfnfrom_offset(offset:FixedOffset) ->CFTimeZone{
67-
CFTimeZone::new(offset.local_minus_utc()asf64)
68-
}
69-
7056
/// The timezone database ID that identifies the time zone. E.g. `"America/Los_Angeles" `or
7157
/// `"Europe/Paris"`.
7258
pubfnname(&self) ->CFString{
@@ -78,22 +64,10 @@ impl CFTimeZone {
7864
mod test{
7965
usesuper::CFTimeZone;
8066

81-
#[cfg(feature ="with-chrono")]
82-
use chrono::{FixedOffset,NaiveDateTime};
83-
8467
#[test]
8568
fntimezone_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-
fntimezone_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)

[8]ページ先頭

©2009-2025 Movatter.jp