Skip to content

Commit 4707b93

Browse files
authored
Re-add try_from_offset_str (#376)
Accidentally got removed in #344
1 parent 4ce3251 commit 4707b93

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

temporal_capi/bindings/c/TimeZone.h

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/TimeZone.d.hpp

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/TimeZone.hpp

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/src/time_zone.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ pub mod ffi {
2121
.map(|x| Box::new(TimeZone(x)))
2222
.map_err(Into::into)
2323
}
24+
pub fn try_from_offset_str(ident: &DiplomatStr) -> Result<Box<Self>, TemporalError> {
25+
temporal_rs::UtcOffset::from_utf8(ident)
26+
.map(|x| Box::new(TimeZone(temporal_rs::TimeZone::UtcOffset(x))))
27+
.map_err(Into::into)
28+
}
2429
pub fn try_from_str(ident: &DiplomatStr) -> Result<Box<Self>, TemporalError> {
2530
let Ok(ident) = str::from_utf8(ident) else {
2631
return Err(temporal_rs::TemporalError::range().into());

0 commit comments

Comments
 (0)