@@ -61,7 +61,7 @@ pub async fn ingest(req: HttpRequest, body: Bytes) -> Result<HttpResponse, PostE
6161 }
6262 create_stream_if_not_exists ( & stream_name, & StreamType :: UserDefined . to_string ( ) ) . await ?;
6363
64- flatten_and_push_logs ( req, body, stream_name) . await ?;
64+ flatten_and_push_logs ( req, body, & stream_name) . await ?;
6565 Ok ( HttpResponse :: Ok ( ) . finish ( ) )
6666 } else {
6767 Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) )
@@ -84,7 +84,7 @@ pub async fn ingest_internal_stream(stream_name: String, body: Bytes) -> Result<
8484 tags : String :: default ( ) ,
8585 metadata : String :: default ( ) ,
8686 } ;
87- event. into_recordbatch ( schema, None , None ) ?
87+ event. into_recordbatch ( & schema, None , None ) ?
8888 } ;
8989 event:: Event {
9090 rb,
@@ -114,9 +114,9 @@ pub async fn handle_otel_ingestion(
114114 . iter ( )
115115 . find ( |& ( key, _) | key == STREAM_NAME_HEADER_KEY )
116116 {
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 ?;
120120 } else {
121121 return Err ( PostError :: Header ( ParseHeaderError :: MissingStreamName ) ) ;
122122 }
@@ -149,7 +149,7 @@ pub async fn post_event(req: HttpRequest, body: Bytes) -> Result<HttpResponse, P
149149 }
150150 }
151151
152- flatten_and_push_logs ( req, body, stream_name) . await ?;
152+ flatten_and_push_logs ( req, body, & stream_name) . await ?;
153153 Ok ( HttpResponse :: Ok ( ) . finish ( ) )
154154}
155155
@@ -319,7 +319,7 @@ mod tests {
319319 . append_header ( ( PREFIX_META . to_string ( ) + "C" , "meta1" ) )
320320 . to_http_request ( ) ;
321321
322- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
322+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
323323
324324 assert_eq ! ( rb. num_rows( ) , 1 ) ;
325325 assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -359,7 +359,7 @@ mod tests {
359359
360360 let req = TestRequest :: default ( ) . to_http_request ( ) ;
361361
362- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
362+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
363363
364364 assert_eq ! ( rb. num_rows( ) , 1 ) ;
365365 assert_eq ! ( rb. num_columns( ) , 5 ) ;
@@ -391,7 +391,7 @@ mod tests {
391391
392392 let req = TestRequest :: default ( ) . to_http_request ( ) ;
393393
394- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
394+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
395395
396396 assert_eq ! ( rb. num_rows( ) , 1 ) ;
397397 assert_eq ! ( rb. num_columns( ) , 5 ) ;
@@ -423,7 +423,7 @@ mod tests {
423423
424424 let req = TestRequest :: default ( ) . to_http_request ( ) ;
425425
426- assert ! ( into_event_batch( req, json, schema, None , None ) . is_err( ) ) ;
426+ assert ! ( into_event_batch( & req, & json, schema, None , None ) . is_err( ) ) ;
427427 }
428428
429429 #[ test]
@@ -441,7 +441,7 @@ mod tests {
441441
442442 let req = TestRequest :: default ( ) . to_http_request ( ) ;
443443
444- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
444+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
445445
446446 assert_eq ! ( rb. num_rows( ) , 1 ) ;
447447 assert_eq ! ( rb. num_columns( ) , 3 ) ;
@@ -453,7 +453,7 @@ mod tests {
453453
454454 let req = TestRequest :: default ( ) . to_http_request ( ) ;
455455
456- assert ! ( into_event_batch( req, json, HashMap :: default ( ) , None , None ) . is_err( ) )
456+ assert ! ( into_event_batch( & req, & json, HashMap :: default ( ) , None , None ) . is_err( ) )
457457 }
458458
459459 #[ test]
@@ -476,7 +476,7 @@ mod tests {
476476
477477 let req = TestRequest :: default ( ) . to_http_request ( ) ;
478478
479- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
479+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
480480
481481 assert_eq ! ( rb. num_rows( ) , 3 ) ;
482482 assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -524,7 +524,7 @@ mod tests {
524524
525525 let req = TestRequest :: default ( ) . to_http_request ( ) ;
526526
527- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
527+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
528528
529529 assert_eq ! ( rb. num_rows( ) , 3 ) ;
530530 assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -572,7 +572,7 @@ mod tests {
572572 ) ;
573573 let req = TestRequest :: default ( ) . to_http_request ( ) ;
574574
575- let ( rb, _) = into_event_batch ( req, json, schema, None , None ) . unwrap ( ) ;
575+ let ( rb, _) = into_event_batch ( & req, & json, schema, None , None ) . unwrap ( ) ;
576576
577577 assert_eq ! ( rb. num_rows( ) , 3 ) ;
578578 assert_eq ! ( rb. num_columns( ) , 6 ) ;
@@ -621,7 +621,7 @@ mod tests {
621621 . into_iter ( ) ,
622622 ) ;
623623
624- assert ! ( into_event_batch( req, json, schema, None , None ) . is_err( ) ) ;
624+ assert ! ( into_event_batch( & req, & json, schema, None , None ) . is_err( ) ) ;
625625 }
626626
627627 #[ test]
@@ -649,7 +649,7 @@ mod tests {
649649
650650 let req = TestRequest :: default ( ) . to_http_request ( ) ;
651651
652- let ( rb, _) = into_event_batch ( req, json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
652+ let ( rb, _) = into_event_batch ( & req, & json, HashMap :: default ( ) , None , None ) . unwrap ( ) ;
653653
654654 assert_eq ! ( rb. num_rows( ) , 4 ) ;
655655 assert_eq ! ( rb. num_columns( ) , 7 ) ;
0 commit comments