@@ -150,18 +150,19 @@ impl PlainDate {
150
150
}
151
151
```
152
152
153
- These methods are flexible enough and allow full coverage of the
154
- Temporal specification.
153
+ These three constructors, ` new_with_overflow ` , ` try_new ` , and ` new ` , are
154
+ fairly flexible and provide full coverage of the Temporal specification.
155
155
156
156
For instance, take the below constructor:
157
157
158
158
``` js
159
- const plainDate = Temporal .PlainDate (2025 , 6 , 9 );
159
+ const plainDate = new Temporal.PlainDate (2025 , 6 , 9 );
160
160
```
161
161
162
162
Can easily be conveyed in Rust as:
163
163
164
164
``` rust
165
+ use temporal_rs :: PlainDate ;
165
166
let plain_date = PlainDate :: try_new (2025 , 6 , 9 , Calendar :: default ())? ;
166
167
```
167
168
@@ -176,6 +177,16 @@ Of course, if you somewhat prefer the brevity of the JavaScript API and
176
177
don't want to list the default ` Calendar ` , ` temporal_rs ` provides the
177
178
additional constructors ` new_iso ` and ` try_new_iso ` .
178
179
180
+ ``` rust
181
+ use temporal_rs :: PlainDate ;
182
+ let plain_date = PlainDate :: try_new_iso (2025 , 6 , 9 )? ;
183
+ ```
184
+
185
+ Interestingly enough, the ` _iso ` constructors are actually extensions of
186
+ Temporal specification to provide a similar API in Rust. This is because
187
+ the ` _iso ` constructors are assumed to exist due to resolving an
188
+ ` undefined ` calendar to the default ISO calendar.
189
+
179
190
## Let's discuss ` Now `
180
191
181
192
> Colonel Sandurz: Now. You're looking at now, sir. Everything that
0 commit comments