Skip to content

Commit 3681be9

Browse files
committed
Add shorthand notation to try_from_codes docs
1 parent 213b7e8 commit 3681be9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/calendar/src/date.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ impl<A: AsCalendar> Date<A> {
178178
/// let date_iso = Date::try_from_codes(YearInput::Extended(1970), Month::new(1), 2, Iso)
179179
/// .expect("Failed to initialize ISO Date instance.");
180180
///
181+
/// // Shorthand using From impls:
182+
/// assert_eq!(date_iso, Date::try_from_codes(1970.into(), 1.into(), 2, Iso).unwrap());
183+
///
181184
/// assert_eq!(date_iso.era_year().year, 1970);
182185
/// assert_eq!(date_iso.month().ordinal, 1);
183186
/// assert_eq!(date_iso.day_of_month().0, 2);

0 commit comments

Comments
 (0)