diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/rust/core-foundation/src/timezone.rs | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/core-foundation/src/timezone.rs')
-rw-r--r-- | third_party/rust/core-foundation/src/timezone.rs | 25 |
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() { |