@@ -446,27 +446,26 @@ impl<'a> Deserialize<'a> for Time {
446446 }
447447}
448448
449- // FIXME: turn these constants into `const { ... }` blocks once we can depend on Rust 1.79.
450- #[ cfg( feature = "parsing" ) ]
451- const UTC_OFFSET_HOUR : modifier:: OffsetHour = {
452- let mut m = modifier:: OffsetHour :: default ( ) ;
453- m. sign_is_mandatory = true ;
454- m
455- } ;
456- #[ cfg( feature = "parsing" ) ]
457- const UTC_OFFSET_MINUTE : modifier:: OffsetMinute = modifier:: OffsetMinute :: default ( ) ;
458- #[ cfg( feature = "parsing" ) ]
459- const UTC_OFFSET_SECOND : modifier:: OffsetSecond = modifier:: OffsetSecond :: default ( ) ;
460449/// The format used when serializing and deserializing a human-readable `UtcOffset`.
461450#[ cfg( feature = "parsing" ) ]
462451const UTC_OFFSET_FORMAT : & [ BorrowedFormatItem < ' _ > ] = & [
463- BorrowedFormatItem :: Component ( Component :: OffsetHour ( UTC_OFFSET_HOUR ) ) ,
452+ BorrowedFormatItem :: Component ( Component :: OffsetHour (
453+ const {
454+ let mut m = modifier:: OffsetHour :: default ( ) ;
455+ m. sign_is_mandatory = true ;
456+ m
457+ } ,
458+ ) ) ,
464459 BorrowedFormatItem :: Optional ( & BorrowedFormatItem :: Compound ( & [
465460 BorrowedFormatItem :: Literal ( b":" ) ,
466- BorrowedFormatItem :: Component ( Component :: OffsetMinute ( UTC_OFFSET_MINUTE ) ) ,
461+ BorrowedFormatItem :: Component ( Component :: OffsetMinute (
462+ const { modifier:: OffsetMinute :: default ( ) } ,
463+ ) ) ,
467464 BorrowedFormatItem :: Optional ( & BorrowedFormatItem :: Compound ( & [
468465 BorrowedFormatItem :: Literal ( b":" ) ,
469- BorrowedFormatItem :: Component ( Component :: OffsetSecond ( UTC_OFFSET_SECOND ) ) ,
466+ BorrowedFormatItem :: Component ( Component :: OffsetSecond (
467+ const { modifier:: OffsetSecond :: default ( ) } ,
468+ ) ) ,
470469 ] ) ) ,
471470 ] ) ) ,
472471] ;
0 commit comments