File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -420,7 +420,10 @@ pub(crate) fn deserialize_query_tags(serialized: &str) -> Vec<(String, Option<St
420420 }
421421 }
422422 match split_at {
423- Some ( i) => ( unescape_query_tag ( & pair[ ..i] ) , Some ( unescape_query_tag ( & pair[ i + 1 ..] ) ) ) ,
423+ Some ( i) => (
424+ unescape_query_tag ( & pair[ ..i] ) ,
425+ Some ( unescape_query_tag ( & pair[ i + 1 ..] ) ) ,
426+ ) ,
424427 None => ( unescape_query_tag ( & pair) , None ) ,
425428 }
426429 } )
@@ -717,8 +720,11 @@ mod tests {
717720 tags. insert ( "team" . to_string ( ) , Some ( "a:b,c\\ d" . to_string ( ) ) ) ;
718721 tags. insert ( "prod" . to_string ( ) , None ) ;
719722 let round_tripped: std:: collections:: HashSet < ( String , Option < String > ) > =
720- deserialize_query_tags ( & serialize_query_tags ( & tags) ) . into_iter ( ) . collect ( ) ;
721- let expected: std:: collections:: HashSet < ( String , Option < String > ) > = tags. into_iter ( ) . collect ( ) ;
723+ deserialize_query_tags ( & serialize_query_tags ( & tags) )
724+ . into_iter ( )
725+ . collect ( ) ;
726+ let expected: std:: collections:: HashSet < ( String , Option < String > ) > =
727+ tags. into_iter ( ) . collect ( ) ;
722728 assert_eq ! ( round_tripped, expected) ;
723729 }
724730}
Original file line number Diff line number Diff line change @@ -525,13 +525,22 @@ mod tests {
525525 result_compression : None ,
526526 parameters : vec ! [ ] ,
527527 query_tags : vec ! [
528- QueryTag { key: "team" . to_string( ) , value: Some ( "eng" . to_string( ) ) } ,
529- QueryTag { key: "prod" . to_string( ) , value: None } ,
528+ QueryTag {
529+ key: "team" . to_string( ) ,
530+ value: Some ( "eng" . to_string( ) ) ,
531+ } ,
532+ QueryTag {
533+ key: "prod" . to_string( ) ,
534+ value: None ,
535+ } ,
530536 ] ,
531537 } ;
532538 let json = serde_json:: to_string ( & req) . unwrap ( ) ;
533539 // Native SEA array shape: [{"key":..,"value":..}], value omitted when None.
534- assert ! ( json. contains( r#""query_tags":[{"key":"team","value":"eng"},{"key":"prod"}]"# ) , "got: {json}" ) ;
540+ assert ! (
541+ json. contains( r#""query_tags":[{"key":"team","value":"eng"},{"key":"prod"}]"# ) ,
542+ "got: {json}"
543+ ) ;
535544 }
536545
537546 #[ test]
You can’t perform that action at this time.
0 commit comments