summaryrefslogtreecommitdiffstats
path: root/third_party/rust/core-foundation/src/timezone.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/core-foundation/src/timezone.rs')
-rw-r--r--third_party/rust/core-foundation/src/timezone.rs25
1 files changed, 10 insertions, 15 deletions
diff --git a/third_party/rust/core-foundation/src/timezone.rs b/third_party/rust/core-foundation/src/timezone.rs
index a8bb2ed1d2..46123dcc22 100644
--- a/third_party/rust/core-foundation/src/timezone.rs
+++ b/third_party/rust/core-foundation/src/timezone.rs
@@ -9,18 +9,17 @@
//! Core Foundation time zone objects.
-pub use core_foundation_sys::timezone::*;
use core_foundation_sys::base::kCFAllocatorDefault;
+pub use core_foundation_sys::timezone::*;
-use base::TCFType;
-use date::{CFDate, CFTimeInterval};
-use string::CFString;
+use crate::base::TCFType;
+use crate::date::{CFDate, CFTimeInterval};
+use crate::string::CFString;
#[cfg(feature = "with-chrono")]
use chrono::{FixedOffset, NaiveDateTime};
-
-declare_TCFType!{
+declare_TCFType! {
/// A time zone.
CFTimeZone, CFTimeZoneRef
}
@@ -54,9 +53,7 @@ impl CFTimeZone {
}
pub fn seconds_from_gmt(&self, date: CFDate) -> CFTimeInterval {
- unsafe {
- CFTimeZoneGetSecondsFromGMT(self.0, date.abs_time())
- }
+ unsafe { CFTimeZoneGetSecondsFromGMT(self.0, date.abs_time()) }
}
#[cfg(feature = "with-chrono")]
@@ -70,12 +67,10 @@ impl CFTimeZone {
CFTimeZone::new(offset.local_minus_utc() as f64)
}
- /// The timezone database ID that identifies the time zone. E.g. "America/Los_Angeles" or
- /// "Europe/Paris".
+ /// The timezone database ID that identifies the time zone. E.g. `"America/Los_Angeles" `or
+ /// `"Europe/Paris"`.
pub fn name(&self) -> CFString {
- unsafe {
- CFString::wrap_under_get_rule(CFTimeZoneGetName(self.0))
- }
+ unsafe { CFString::wrap_under_get_rule(CFTimeZoneGetName(self.0)) }
}
}
@@ -84,7 +79,7 @@ mod test {
use super::CFTimeZone;
#[cfg(feature = "with-chrono")]
- use chrono::{NaiveDateTime, FixedOffset};
+ use chrono::{FixedOffset, NaiveDateTime};
#[test]
fn timezone_comparison() {