@@ -1260,30 +1260,30 @@ config_namespace! {
12601260 }
12611261}
12621262
1263- impl < ' a > TryInto < arrow:: util:: display:: FormatOptions < ' a > > for & ' a FormatOptions {
1263+ impl < ' a > TryFrom < & ' a FormatOptions > for arrow:: util:: display:: FormatOptions < ' a > {
12641264 type Error = DataFusionError ;
1265- fn try_into ( self ) -> Result < arrow :: util :: display :: FormatOptions < ' a > > {
1266- let duration_format = match self . duration_format . as_str ( ) {
1265+ fn try_from ( options : & ' a FormatOptions ) -> Result < Self > {
1266+ let duration_format = match options . duration_format . as_str ( ) {
12671267 "pretty" => arrow:: util:: display:: DurationFormat :: Pretty ,
12681268 "iso8601" => arrow:: util:: display:: DurationFormat :: ISO8601 ,
12691269 _ => {
12701270 return _config_err ! (
12711271 "Invalid duration format: {}. Valid values are pretty or iso8601" ,
1272- self . duration_format
1272+ options . duration_format
12731273 ) ;
12741274 }
12751275 } ;
12761276
1277- Ok ( arrow :: util :: display :: FormatOptions :: new ( )
1278- . with_display_error ( self . safe )
1279- . with_null ( & self . null )
1280- . with_date_format ( self . date_format . as_deref ( ) )
1281- . with_datetime_format ( self . datetime_format . as_deref ( ) )
1282- . with_timestamp_format ( self . timestamp_format . as_deref ( ) )
1283- . with_timestamp_tz_format ( self . timestamp_tz_format . as_deref ( ) )
1284- . with_time_format ( self . time_format . as_deref ( ) )
1277+ Ok ( Self :: new ( )
1278+ . with_display_error ( options . safe )
1279+ . with_null ( & options . null )
1280+ . with_date_format ( options . date_format . as_deref ( ) )
1281+ . with_datetime_format ( options . datetime_format . as_deref ( ) )
1282+ . with_timestamp_format ( options . timestamp_format . as_deref ( ) )
1283+ . with_timestamp_tz_format ( options . timestamp_tz_format . as_deref ( ) )
1284+ . with_time_format ( options . time_format . as_deref ( ) )
12851285 . with_duration_format ( duration_format)
1286- . with_types_info ( self . types_info ) )
1286+ . with_types_info ( options . types_info ) )
12871287 }
12881288}
12891289
0 commit comments