Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions temporal_capi/bindings/c/TimeZone.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions temporal_capi/bindings/cpp/temporal_rs/TimeZone.d.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions temporal_capi/bindings/cpp/temporal_rs/TimeZone.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions temporal_capi/src/time_zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,20 @@ pub mod ffi {
Box::new(Self(temporal_rs::TimeZone::utc()))
}

pub fn utc_with_provider<'p>(p: &Provider<'p>) -> Result<Box<Self>, TemporalError> {
Ok(Box::new(Self(with_provider!(p, |p| {
temporal_rs::TimeZone::utc_with_provider(p)
}))))
}

/// Create a TimeZone that represents +00:00
///
/// This is the only way to infallibly make a TimeZone without compiled_data,
/// and can be used as a fallback.
pub fn zero() -> Box<Self> {
// TODO merge signature with below
Box::new(Self(temporal_rs::TimeZone::UtcOffset(Default::default())))
}

pub fn utc_with_provider<'p>(p: &Provider<'p>) -> Result<Box<Self>, TemporalError> {
Ok(Box::new(Self(with_provider!(p, |p| {
temporal_rs::TimeZone::utc_with_provider(p)
}))))
}

#[allow(clippy::should_implement_trait)]
pub fn clone(&self) -> Box<TimeZone> {
Box::new(TimeZone(self.0))
Expand Down
Loading