2222//! [s5]: https://graphql-scalars.dev/docs/scalars/utc-offset
2323
2424use time:: {
25- format_description:: { well_known:: Rfc3339 , FormatItem } ,
25+ format_description:: { well_known:: Rfc3339 , BorrowedFormatItem } ,
2626 macros:: format_description,
2727} ;
2828
@@ -52,12 +52,12 @@ mod date {
5252 /// Format of a [`Date` scalar][1].
5353 ///
5454 /// [1]: https://graphql-scalars.dev/docs/scalars/date
55- const FORMAT : & [ FormatItem < ' _ > ] = format_description ! ( "[year]-[month]-[day]" ) ;
55+ const FORMAT : & [ BorrowedFormatItem < ' _ > ] = format_description ! ( "[year]-[month]-[day]" ) ;
5656
5757 pub ( super ) fn to_output < S : ScalarValue > ( v : & Date ) -> Value < S > {
5858 Value :: scalar (
5959 v. format ( FORMAT )
60- . unwrap_or_else ( |e| panic ! ( "Failed to format `Date`: {e}" ) ) ,
60+ . unwrap_or_else ( |e| panic ! ( "failed to format `Date`: {e}" ) ) ,
6161 )
6262 }
6363
@@ -89,18 +89,19 @@ mod local_time {
8989 /// Full format of a [`LocalTime` scalar][1].
9090 ///
9191 /// [1]: https://graphql-scalars.dev/docs/scalars/local-time
92- const FORMAT : & [ FormatItem < ' _ > ] =
92+ const FORMAT : & [ BorrowedFormatItem < ' _ > ] =
9393 format_description ! ( "[hour]:[minute]:[second].[subsecond digits:3]" ) ;
9494
9595 /// Format of a [`LocalTime` scalar][1] without milliseconds.
9696 ///
9797 /// [1]: https://graphql-scalars.dev/docs/scalars/local-time
98- const FORMAT_NO_MILLIS : & [ FormatItem < ' _ > ] = format_description ! ( "[hour]:[minute]:[second]" ) ;
98+ const FORMAT_NO_MILLIS : & [ BorrowedFormatItem < ' _ > ] =
99+ format_description ! ( "[hour]:[minute]:[second]" ) ;
99100
100101 /// Format of a [`LocalTime` scalar][1] without seconds.
101102 ///
102103 /// [1]: https://graphql-scalars.dev/docs/scalars/local-time
103- const FORMAT_NO_SECS : & [ FormatItem < ' _ > ] = format_description ! ( "[hour]:[minute]" ) ;
104+ const FORMAT_NO_SECS : & [ BorrowedFormatItem < ' _ > ] = format_description ! ( "[hour]:[minute]" ) ;
104105
105106 pub ( super ) fn to_output < S : ScalarValue > ( v : & LocalTime ) -> Value < S > {
106107 Value :: scalar (
@@ -109,7 +110,7 @@ mod local_time {
109110 } else {
110111 v. format ( FORMAT )
111112 }
112- . unwrap_or_else ( |e| panic ! ( "Failed to format `LocalTime`: {e}" ) ) ,
113+ . unwrap_or_else ( |e| panic ! ( "failed to format `LocalTime`: {e}" ) ) ,
113114 )
114115 }
115116
@@ -140,13 +141,13 @@ mod local_date_time {
140141 use super :: * ;
141142
142143 /// Format of a [`LocalDateTime`] scalar.
143- const FORMAT : & [ FormatItem < ' _ > ] =
144+ const FORMAT : & [ BorrowedFormatItem < ' _ > ] =
144145 format_description ! ( "[year]-[month]-[day] [hour]:[minute]:[second]" ) ;
145146
146147 pub ( super ) fn to_output < S : ScalarValue > ( v : & LocalDateTime ) -> Value < S > {
147148 Value :: scalar (
148149 v. format ( FORMAT )
149- . unwrap_or_else ( |e| panic ! ( "Failed to format `LocalDateTime`: {e}" ) ) ,
150+ . unwrap_or_else ( |e| panic ! ( "failed to format `LocalDateTime`: {e}" ) ) ,
150151 )
151152 }
152153
@@ -185,7 +186,7 @@ mod date_time {
185186 Value :: scalar (
186187 v. to_offset ( UtcOffset :: UTC )
187188 . format ( & Rfc3339 )
188- . unwrap_or_else ( |e| panic ! ( "Failed to format `DateTime`: {e}" ) ) ,
189+ . unwrap_or_else ( |e| panic ! ( "failed to format `DateTime`: {e}" ) ) ,
189190 )
190191 }
191192
@@ -202,7 +203,7 @@ mod date_time {
202203/// Format of a [`UtcOffset` scalar][1].
203204///
204205/// [1]: https://graphql-scalars.dev/docs/scalars/utc-offset
205- const UTC_OFFSET_FORMAT : & [ FormatItem < ' _ > ] =
206+ const UTC_OFFSET_FORMAT : & [ BorrowedFormatItem < ' _ > ] =
206207 format_description ! ( "[offset_hour sign:mandatory]:[offset_minute]" ) ;
207208
208209/// Offset from UTC in `±hh:mm` format. See [list of database time zones][0].
@@ -227,7 +228,7 @@ mod utc_offset {
227228 pub ( super ) fn to_output < S : ScalarValue > ( v : & UtcOffset ) -> Value < S > {
228229 Value :: scalar (
229230 v. format ( UTC_OFFSET_FORMAT )
230- . unwrap_or_else ( |e| panic ! ( "Failed to format `UtcOffset`: {e}" ) ) ,
231+ . unwrap_or_else ( |e| panic ! ( "failed to format `UtcOffset`: {e}" ) ) ,
231232 )
232233 }
233234
0 commit comments