Skip to content

Remove num-bigint dependency and rely on primitives #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 31, 2024
Merged

Conversation

nekevss
Copy link
Member

@nekevss nekevss commented Oct 30, 2024

This PR removes the num_bigint dependency from the project that was primarily technical debt from the earlier days of temporal_rs

// 1. Let timeZone be the this value.
// 2. Perform ? RequireInternalSlot(timeZone, [[InitializedTemporalTimeZone]]).
// 3. Set instant to ? ToTemporalInstant(instant).
// 4. If timeZone.[[OffsetMinutes]] is not empty, return 𝔽(timeZone.[[OffsetMinutes]] × (60 × 10^9)).
if let Some(offset) = &self.offset {
return Ok(BigInt::from(i64::from(*offset) * 60_000_000_000i64));
return Ok(i128::from(*offset) * 60_000_000_000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to add a comment under the offset property to say its offset minutes from UTC, as it's more descriptively called offsetMinutes in the spec

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jedel1043 jedel1043 added C-enhancement New feature or request C-internal Internal library improvements labels Oct 31, 2024
@jedel1043 jedel1043 merged commit 37a4e06 into main Oct 31, 2024
5 checks passed
@jedel1043 jedel1043 deleted the remove-bigint branch October 31, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request C-internal Internal library improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants