7
7
8
8
use crate :: matcher:: Tree ;
9
9
use crate :: matcher:: base_log_matcher:: tag_match:: Value_match :: DoubleValueMatch ;
10
- use bd_log_primitives:: tiny_set:: TinyMap ;
11
10
use bd_log_primitives:: {
12
11
EMPTY_FIELDS ,
13
12
FieldsRef ,
@@ -34,6 +33,7 @@ use log_matcher::base_log_matcher::tag_match::Value_match::{
34
33
use log_matcher:: { BaseLogMatcher , Matcher , MatcherList , base_log_matcher} ;
35
34
use pretty_assertions:: assert_eq;
36
35
use protobuf:: MessageField ;
36
+ use std:: collections:: BTreeMap ;
37
37
38
38
type Input < ' a > = ( LogType , LogLevel , LogMessage , LogFields ) ;
39
39
@@ -230,7 +230,7 @@ fn test_extracted_string_matcher() {
230
230
( log_tag( "keyx" , "exact" ) , false ) ,
231
231
( log_msg( "no fields" ) , false ) ,
232
232
] ,
233
- & TinyMap :: default ( ) ,
233
+ None ,
234
234
) ;
235
235
236
236
match_test_runner_with_extractions (
@@ -240,7 +240,7 @@ fn test_extracted_string_matcher() {
240
240
( log_tag( "keyx" , "exact" ) , false ) ,
241
241
( log_msg( "no fields" ) , false ) ,
242
242
] ,
243
- & [ ( "id1" . to_string ( ) , "exact" . to_string ( ) ) ] . into ( ) ,
243
+ Some ( & BTreeMap :: from ( [ ( "id1" . to_string ( ) , "exact" . to_string ( ) ) ] ) ) ,
244
244
) ;
245
245
}
246
246
@@ -309,20 +309,20 @@ fn test_extracted_double_matcher() {
309
309
( log_tag( "key" , "13.0" ) , false ) ,
310
310
( log_tag( "key" , "13" ) , false ) ,
311
311
] ,
312
- & TinyMap :: default ( ) ,
312
+ None ,
313
313
) ;
314
314
match_test_runner_with_extractions (
315
315
config. clone ( ) ,
316
316
vec ! [
317
317
( log_tag( "key" , "13.0" ) , false ) ,
318
318
( log_tag( "key" , "13" ) , false ) ,
319
319
] ,
320
- & [ ( "id1" . to_string ( ) , "bad" . to_string ( ) ) ] . into ( ) ,
320
+ Some ( & BTreeMap :: from ( [ ( "id1" . to_string ( ) , "bad" . to_string ( ) ) ] ) ) ,
321
321
) ;
322
322
match_test_runner_with_extractions (
323
323
config,
324
324
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 ( ) ) ] ) ) ,
326
326
) ;
327
327
}
328
328
@@ -419,13 +419,13 @@ fn test_extracted_int_matcher() {
419
419
( log_tag( "key" , "13" ) , false ) ,
420
420
( log_tag( "key" , "13.0" ) , false ) ,
421
421
] ,
422
- & TinyMap :: default ( ) ,
422
+ None ,
423
423
) ;
424
424
425
425
match_test_runner_with_extractions (
426
426
config,
427
427
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 ( ) ) ] ) ) ,
429
429
) ;
430
430
}
431
431
@@ -856,14 +856,14 @@ fn make_message_match(operator: Operator, match_value: &str) -> base_log_matcher
856
856
857
857
#[ allow( clippy:: needless_pass_by_value) ]
858
858
fn 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 ) ;
860
860
}
861
861
862
862
#[ allow( clippy:: needless_pass_by_value) ]
863
863
fn match_test_runner_with_extractions (
864
864
config : LogMatcher ,
865
865
cases : Vec < ( Input < ' _ > , bool ) > ,
866
- extracted_fields : & TinyMap < String , String > ,
866
+ extracted_fields : Option < & BTreeMap < String , String > > ,
867
867
) {
868
868
let match_tree = Tree :: new ( & config) . unwrap ( ) ;
869
869
0 commit comments