Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/builtins/compiled/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod zoneddatetime;
mod options {
use crate::{builtins::TZ_PROVIDER, options::RelativeTo, TemporalResult};

impl RelativeTo {
impl RelativeTo<'_> {
pub fn try_from_str(source: &str) -> TemporalResult<Self> {
Self::try_from_str_with_provider(source, &*TZ_PROVIDER)
}
Expand Down
18 changes: 9 additions & 9 deletions src/options/relative_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ use crate::options::{ArithmeticOverflow, Disambiguation, OffsetDisambiguation};
use crate::parsers::parse_date_time;
use crate::provider::TimeZoneProvider;
use crate::{TemporalResult, TemporalUnwrap};

use alloc::borrow::Cow;
use ixdtf::parsers::records::UtcOffsetRecordOrZ;

// ==== RelativeTo Object ====

#[derive(Debug, Clone)]
pub enum RelativeTo {
PlainDate(PlainDate),
ZonedDateTime(ZonedDateTime),
pub enum RelativeTo<'a> {
PlainDate(Cow<'a, PlainDate>),
ZonedDateTime(Cow<'a, ZonedDateTime>),
}

impl From<PlainDate> for RelativeTo {
impl From<PlainDate> for RelativeTo<'_> {
fn from(value: PlainDate) -> Self {
Self::PlainDate(value)
Self::PlainDate(Cow::Owned(value))
}
}

impl From<ZonedDateTime> for RelativeTo {
impl From<ZonedDateTime> for RelativeTo<'_> {
fn from(value: ZonedDateTime) -> Self {
Self::ZonedDateTime(value)
Self::ZonedDateTime(Cow::Owned(value))
}
}

impl RelativeTo {
impl RelativeTo<'_> {
/// Attempts to parse a `ZonedDateTime` string falling back to a `PlainDate`
/// if possible.
///
Expand Down
12 changes: 12 additions & 0 deletions temporal_capi/bindings/c/Duration.h

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

3 changes: 3 additions & 0 deletions temporal_capi/bindings/c/Instant.h

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

25 changes: 25 additions & 0 deletions temporal_capi/bindings/c/OwnedRelativeTo.d.h

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

28 changes: 28 additions & 0 deletions temporal_capi/bindings/c/OwnedRelativeTo.h

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

25 changes: 25 additions & 0 deletions temporal_capi/bindings/c/RelativeTo.d.h

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

22 changes: 22 additions & 0 deletions temporal_capi/bindings/c/RelativeTo.h

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

9 changes: 9 additions & 0 deletions temporal_capi/bindings/cpp/temporal_rs/Duration.d.hpp

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

33 changes: 33 additions & 0 deletions temporal_capi/bindings/cpp/temporal_rs/Duration.hpp

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

4 changes: 4 additions & 0 deletions temporal_capi/bindings/cpp/temporal_rs/Instant.d.hpp

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

9 changes: 9 additions & 0 deletions temporal_capi/bindings/cpp/temporal_rs/Instant.hpp

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

54 changes: 54 additions & 0 deletions temporal_capi/bindings/cpp/temporal_rs/OwnedRelativeTo.d.hpp

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

Loading
Loading