Skip to content

Commit cb6c41a

Browse files
committed
Post-rebase cargo fmt and small fix in README
1 parent b3f09c9 commit cb6c41a

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
`Temporal` is a calendar and timezone aware date/time library that is currently being designed and proposed as a new
66
builtin to the `ECMAScript` specification.
77

8-
This crate is an implementation of `Temporal` in Rust. While initially developed for the `Boa`, the crate has been externalized
8+
This crate is an implementation of `Temporal` in Rust. While initially developed for `Boa`, the crate has been externalized
99
as we intended to make an engine agnostic and general usage implementation of `Temporal` and its algorithms.
1010

1111
## Temporal Proposal

src/components/date.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ use crate::{
1515
};
1616
use std::str::FromStr;
1717

18-
use super::{duration::{normalized::NormalizedDurationRecord, TimeDuration}, MonthDay, Time, YearMonth};
18+
use super::{
19+
duration::{normalized::NormalizedDurationRecord, TimeDuration},
20+
MonthDay, Time, YearMonth,
21+
};
1922

2023
/// The native Rust implementation of `Temporal.PlainDate`.
2124
#[non_exhaustive]
@@ -183,7 +186,7 @@ impl Date {
183186
rounding_increment,
184187
smallest_unit,
185188
rounding_mode,
186-
)?
189+
)?
187190
.0
188191
.date()
189192
} else {

src/components/datetime.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
//! This module implements `DateTime` any directly related algorithms.
22
33
use crate::{
4-
components::{
5-
calendar::Calendar,
6-
duration::TimeDuration,
7-
Instant,
8-
},
4+
components::{calendar::Calendar, duration::TimeDuration, Instant},
95
iso::{IsoDate, IsoDateSlots, IsoDateTime, IsoTime},
106
options::{ArithmeticOverflow, RoundingIncrement, TemporalRoundingMode, TemporalUnit},
117
parsers::parse_date_time,
@@ -110,9 +106,7 @@ impl DateTime {
110106
}
111107

112108
// 4. Let diff be ? DifferenceISODateTime(y1, mon1, d1, h1, min1, s1, ms1, mus1, ns1, y2, mon2, d2, h2, min2, s2, ms2, mus2, ns2, calendarRec, largestUnit, resolvedOptions).
113-
let diff = self
114-
.iso
115-
.diff(&other.iso, &self.calendar, largest_unit)?;
109+
let diff = self.iso.diff(&other.iso, &self.calendar, largest_unit)?;
116110

117111
// 5. If smallestUnit is "nanosecond" and roundingIncrement = 1, then
118112
if smallest_unit == TemporalUnit::Nanosecond && increment.get() == 1 {

src/components/duration.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,7 @@ impl Duration {
560560
|| self.days() == 0.0;
561561

562562
// 34. If zonedRelativeTo is not undefined and plainDateTimeOrRelativeToWillBeUsed is true, then
563-
let _precalculated: Option<DateTime> = if relative_to.zdt.is_some() && pdtr_will_be_used
564-
{
563+
let _precalculated: Option<DateTime> = if relative_to.zdt.is_some() && pdtr_will_be_used {
565564
return Err(TemporalError::general("Not yet implemented."));
566565
// a. NOTE: The above conditions mean that the corresponding Temporal.PlainDateTime or
567566
// Temporal.PlainDate for zonedRelativeTo will be used in one of the operations below.
@@ -601,10 +600,8 @@ impl Duration {
601600
)?;
602601

603602
// c. Let targetDate be ? AddDate(calendarRec, plainRelativeTo, dateDuration).
604-
let target_date = plain_date.add_date(
605-
&Duration::from_date_duration(&date_duration),
606-
None,
607-
)?;
603+
let target_date =
604+
plain_date.add_date(&Duration::from_date_duration(&date_duration), None)?;
608605

609606
let plain_dt = DateTime::new_unchecked(
610607
IsoDateTime::new(plain_date.iso, IsoTime::default())?,

0 commit comments

Comments
 (0)