77
88use  crate :: matcher:: Tree ; 
99use  crate :: matcher:: base_log_matcher:: tag_match:: Value_match :: DoubleValueMatch ; 
10- use  bd_log_primitives:: tiny_set:: TinyMap ; 
1110use  bd_log_primitives:: { 
1211  EMPTY_FIELDS , 
1312  FieldsRef , 
@@ -34,6 +33,7 @@ use log_matcher::base_log_matcher::tag_match::Value_match::{
3433use  log_matcher:: { BaseLogMatcher ,  Matcher ,  MatcherList ,  base_log_matcher} ; 
3534use  pretty_assertions:: assert_eq; 
3635use  protobuf:: MessageField ; 
36+ use  std:: collections:: BTreeMap ; 
3737
3838type  Input < ' a >  = ( LogType ,  LogLevel ,  LogMessage ,  LogFields ) ; 
3939
@@ -230,7 +230,7 @@ fn test_extracted_string_matcher() {
230230      ( log_tag( "keyx" ,  "exact" ) ,  false ) , 
231231      ( log_msg( "no fields" ) ,  false ) , 
232232    ] , 
233-     & TinyMap :: default ( ) , 
233+     None , 
234234  ) ; 
235235
236236  match_test_runner_with_extractions ( 
@@ -240,7 +240,7 @@ fn test_extracted_string_matcher() {
240240      ( log_tag( "keyx" ,  "exact" ) ,  false ) , 
241241      ( log_msg( "no fields" ) ,  false ) , 
242242    ] , 
243-     & [ ( "id1" . to_string ( ) ,  "exact" . to_string ( ) ) ] . into ( ) , 
243+     Some ( & BTreeMap :: from ( [ ( "id1" . to_string ( ) ,  "exact" . to_string ( ) ) ] ) ) , 
244244  ) ; 
245245} 
246246
@@ -309,20 +309,20 @@ fn test_extracted_double_matcher() {
309309      ( log_tag( "key" ,  "13.0" ) ,  false ) , 
310310      ( log_tag( "key" ,  "13" ) ,  false ) , 
311311    ] , 
312-     & TinyMap :: default ( ) , 
312+     None , 
313313  ) ; 
314314  match_test_runner_with_extractions ( 
315315    config. clone ( ) , 
316316    vec ! [ 
317317      ( log_tag( "key" ,  "13.0" ) ,  false ) , 
318318      ( log_tag( "key" ,  "13" ) ,  false ) , 
319319    ] , 
320-     & [ ( "id1" . to_string ( ) ,  "bad" . to_string ( ) ) ] . into ( ) , 
320+     Some ( & BTreeMap :: from ( [ ( "id1" . to_string ( ) ,  "bad" . to_string ( ) ) ] ) ) , 
321321  ) ; 
322322  match_test_runner_with_extractions ( 
323323    config, 
324324    vec ! [ ( log_tag( "key" ,  "13.0" ) ,  true ) ,  ( log_tag( "key" ,  "13" ) ,  true ) ] , 
325-     & [ ( "id1" . to_string ( ) ,  "13" . to_string ( ) ) ] . into ( ) , 
325+     Some ( & BTreeMap :: from ( [ ( "id1" . to_string ( ) ,  "13" . to_string ( ) ) ] ) ) , 
326326  ) ; 
327327} 
328328
@@ -419,13 +419,13 @@ fn test_extracted_int_matcher() {
419419      ( log_tag( "key" ,  "13" ) ,  false ) , 
420420      ( log_tag( "key" ,  "13.0" ) ,  false ) , 
421421    ] , 
422-     & TinyMap :: default ( ) , 
422+     None , 
423423  ) ; 
424424
425425  match_test_runner_with_extractions ( 
426426    config, 
427427    vec ! [ ( log_tag( "key" ,  "13" ) ,  true ) ,  ( log_tag( "key" ,  "13.0" ) ,  true ) ] , 
428-     & [ ( "id1" . to_string ( ) ,  "13" . to_string ( ) ) ] . into ( ) , 
428+     Some ( & BTreeMap :: from ( [ ( "id1" . to_string ( ) ,  "13" . to_string ( ) ) ] ) ) , 
429429  ) ; 
430430} 
431431
@@ -856,14 +856,14 @@ fn make_message_match(operator: Operator, match_value: &str) -> base_log_matcher
856856
857857#[ allow( clippy:: needless_pass_by_value) ]  
858858fn  match_test_runner ( config :  LogMatcher ,  cases :  Vec < ( Input < ' _ > ,  bool ) > )  { 
859-   match_test_runner_with_extractions ( config,  cases,  & TinyMap :: default ( ) ) ; 
859+   match_test_runner_with_extractions ( config,  cases,  None ) ; 
860860} 
861861
862862#[ allow( clippy:: needless_pass_by_value) ]  
863863fn  match_test_runner_with_extractions ( 
864864  config :  LogMatcher , 
865865  cases :  Vec < ( Input < ' _ > ,  bool ) > , 
866-   extracted_fields :  & TinyMap < String ,  String > , 
866+   extracted_fields :  Option < & BTreeMap < String ,  String > > , 
867867)  { 
868868  let  match_tree = Tree :: new ( & config) . unwrap ( ) ; 
869869
0 commit comments