@@ -1382,18 +1382,21 @@ impl ConfigErrors {
1382
1382
1383
1383
impl fmt:: Display for ConfigErrors {
1384
1384
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1385
- let errors = self . 0 . iter ( ) . format_with ( "\n " , |inner, f| match & * * inner {
1386
- ConfigErrorInner :: Json { config_key : key, error : e } => {
1387
- f ( key) ?;
1388
- f ( & ": " ) ?;
1389
- f ( e)
1390
- }
1391
- ConfigErrorInner :: Toml { config_key : key, error : e } => {
1392
- f ( key) ?;
1393
- f ( & ": " ) ?;
1394
- f ( e)
1395
- }
1396
- ConfigErrorInner :: ParseError { reason } => f ( reason) ,
1385
+ let errors = self . 0 . iter ( ) . format_with ( "\n " , |inner, f| {
1386
+ match & * * inner {
1387
+ ConfigErrorInner :: Json { config_key : key, error : e } => {
1388
+ f ( key) ?;
1389
+ f ( & ": " ) ?;
1390
+ f ( e)
1391
+ }
1392
+ ConfigErrorInner :: Toml { config_key : key, error : e } => {
1393
+ f ( key) ?;
1394
+ f ( & ": " ) ?;
1395
+ f ( e)
1396
+ }
1397
+ ConfigErrorInner :: ParseError { reason } => f ( reason) ,
1398
+ } ?;
1399
+ f ( & ";" )
1397
1400
} ) ;
1398
1401
write ! ( f, "invalid config value{}:\n {}" , if self . 0 . len( ) == 1 { "" } else { "s" } , errors)
1399
1402
}
@@ -3091,15 +3094,15 @@ fn get_field_json<T: DeserializeOwned>(
3091
3094
json. pointer_mut ( & pointer)
3092
3095
. map ( |it| serde_json:: from_value ( it. take ( ) ) . map_err ( |e| ( e, pointer) ) )
3093
3096
} )
3094
- . find ( Result :: is_ok)
3095
- . and_then ( |res| match res {
3097
+ . flat_map ( |res| match res {
3096
3098
Ok ( it) => Some ( it) ,
3097
3099
Err ( ( e, pointer) ) => {
3098
3100
tracing:: warn!( "Failed to deserialize config field at {}: {:?}" , pointer, e) ;
3099
3101
error_sink. push ( ( pointer, e) ) ;
3100
3102
None
3101
3103
}
3102
3104
} )
3105
+ . next ( )
3103
3106
}
3104
3107
3105
3108
fn get_field_toml < T : DeserializeOwned > (
0 commit comments