@@ -61,7 +61,7 @@ pub async fn ingest(req: HttpRequest, body: Bytes) -> Result<HttpResponse, PostE
61
61
}
62
62
create_stream_if_not_exists ( & stream_name, & StreamType :: UserDefined . to_string ( ) ) . await ?;
63
63
64
- flatten_and_push_logs ( req, body, stream_name) . await ?;
64
+ flatten_and_push_logs ( req, body, & stream_name) . await ?;
65
65
Ok ( HttpResponse :: Ok ( ) . finish ( ) )
66
66
} else {
67
67
Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) )
@@ -114,9 +114,9 @@ pub async fn handle_otel_ingestion(
114
114
. iter ( )
115
115
. find ( |& ( key, _) | key == STREAM_NAME_HEADER_KEY )
116
116
{
117
- let stream_name = stream_name. to_str ( ) . unwrap ( ) . to_owned ( ) ;
118
- create_stream_if_not_exists ( & stream_name, & StreamType :: UserDefined . to_string ( ) ) . await ?;
119
- push_logs ( stream_name. to_string ( ) , req. clone ( ) , body) . await ?;
117
+ let stream_name = stream_name. to_str ( ) . unwrap ( ) ;
118
+ create_stream_if_not_exists ( stream_name, & StreamType :: UserDefined . to_string ( ) ) . await ?;
119
+ push_logs ( stream_name, & req, & body) . await ?;
120
120
} else {
121
121
return Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) ) ;
122
122
}
@@ -149,7 +149,7 @@ pub async fn post_event(req: HttpRequest, body: Bytes) -> Result<HttpResponse, P
149
149
}
150
150
}
151
151
152
- flatten_and_push_logs ( req, body, stream_name) . await ?;
152
+ flatten_and_push_logs ( req, body, & stream_name) . await ?;
153
153
Ok ( HttpResponse :: Ok ( ) . finish ( ) )
154
154
}
155
155
@@ -314,7 +314,7 @@ mod tests {
314
314
. append_header ( ( PREFIX_META . to_string ( ) + "C" , "meta1" ) )
315
315
. to_http_request ( ) ;
316
316
317
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
317
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
318
318
319
319
assert_eq ! ( rb. num_rows( ) , 1 ) ;
320
320
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -354,7 +354,7 @@ mod tests {
354
354
355
355
let req = TestRequest :: default ( ) . to_http_request ( ) ;
356
356
357
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
357
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
358
358
359
359
assert_eq ! ( rb. num_rows( ) , 1 ) ;
360
360
assert_eq ! ( rb. num_columns( ) , 5 ) ;
@@ -386,7 +386,7 @@ mod tests {
386
386
387
387
let req = TestRequest :: default ( ) . to_http_request ( ) ;
388
388
389
- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
389
+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
390
390
391
391
assert_eq ! ( rb. num_rows( ) , 1 ) ;
392
392
assert_eq ! ( rb. num_columns( ) , 5 ) ;
@@ -418,7 +418,7 @@ mod tests {
418
418
419
419
let req = TestRequest :: default ( ) . to_http_request ( ) ;
420
420
421
- assert ! ( into_event_batch( req, json, schema, None , None ) . is_err( ) ) ;
421
+ assert ! ( into_event_batch( & req, & json, schema, None , None ) . is_err( ) ) ;
422
422
}
423
423
424
424
#[ test]
@@ -436,7 +436,7 @@ mod tests {
436
436
437
437
let req = TestRequest :: default ( ) . to_http_request ( ) ;
438
438
439
- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
439
+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
440
440
441
441
assert_eq ! ( rb. num_rows( ) , 1 ) ;
442
442
assert_eq ! ( rb. num_columns( ) , 3 ) ;
@@ -448,7 +448,7 @@ mod tests {
448
448
449
449
let req = TestRequest :: default ( ) . to_http_request ( ) ;
450
450
451
- assert ! ( into_event_batch( req, json, HashMap :: default ( ) , None , None ) . is_err( ) )
451
+ assert ! ( into_event_batch( & req, & json, HashMap :: default ( ) , None , None ) . is_err( ) )
452
452
}
453
453
454
454
#[ test]
@@ -471,7 +471,7 @@ mod tests {
471
471
472
472
let req = TestRequest :: default ( ) . to_http_request ( ) ;
473
473
474
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
474
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
475
475
476
476
assert_eq ! ( rb. num_rows( ) , 3 ) ;
477
477
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -519,7 +519,7 @@ mod tests {
519
519
520
520
let req = TestRequest :: default ( ) . to_http_request ( ) ;
521
521
522
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
522
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
523
523
524
524
assert_eq ! ( rb. num_rows( ) , 3 ) ;
525
525
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -567,7 +567,7 @@ mod tests {
567
567
) ;
568
568
let req = TestRequest :: default ( ) . to_http_request ( ) ;
569
569
570
- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
570
+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
571
571
572
572
assert_eq ! ( rb. num_rows( ) , 3 ) ;
573
573
assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -616,7 +616,7 @@ mod tests {
616
616
. into_iter ( ) ,
617
617
) ;
618
618
619
- assert ! ( into_event_batch( req, json, schema, None , None ) . is_err( ) ) ;
619
+ assert ! ( into_event_batch( & req, & json, schema, None , None ) . is_err( ) ) ;
620
620
}
621
621
622
622
#[ test]
@@ -644,7 +644,7 @@ mod tests {
644
644
645
645
let req = TestRequest :: default ( ) . to_http_request ( ) ;
646
646
647
- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
647
+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
648
648
649
649
assert_eq ! ( rb. num_rows( ) , 4 ) ;
650
650
assert_eq ! ( rb. num_columns( ) , 7 ) ;
0 commit comments