From 7e2fc6de1287590784079a545ce80d132002f405 Mon Sep 17 00:00:00 2001 From: Eugene Tolbakov Date: Sat, 9 Dec 2023 09:48:36 +0000 Subject: [PATCH] chore: minor style adjustments --- quickwit/quickwit-serve/src/jaeger_api/model.rs | 5 ++--- quickwit/quickwit-serve/src/jaeger_api/rest_handler.rs | 4 ++-- quickwit/quickwit-serve/src/rest.rs | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/quickwit/quickwit-serve/src/jaeger_api/model.rs b/quickwit/quickwit-serve/src/jaeger_api/model.rs index 8f72452b7fd..651b8e3e111 100644 --- a/quickwit/quickwit-serve/src/jaeger_api/model.rs +++ b/quickwit/quickwit-serve/src/jaeger_api/model.rs @@ -90,7 +90,7 @@ impl JaegerTrace { /// The logic has been replicated from /// https://github.com/jaegertracing/jaeger/blob/995231c42cadd70bce2bbbf02579e33f6e6329c8/model/converter/json/process_hashtable.go#L37 fn handle_span_processes( - spans: &mut Vec, + spans: &mut [JaegerSpan], count: &mut i32, acc: &mut HashMap>, ) { @@ -126,7 +126,7 @@ impl JaegerTrace { data: &HashMap>, ) -> HashMap { let mut result: HashMap = HashMap::new(); - for (_, processes) in data { + for processes in data.values() { for process in processes { result.insert(process.key.clone(), process.clone()); } @@ -315,7 +315,6 @@ impl JaegerProcess { } } - /// pub fn next_key(count: &i32) -> String { format!("p{}", count) } diff --git a/quickwit/quickwit-serve/src/jaeger_api/rest_handler.rs b/quickwit/quickwit-serve/src/jaeger_api/rest_handler.rs index e3ed1f45a5f..733796691d5 100644 --- a/quickwit/quickwit-serve/src/jaeger_api/rest_handler.rs +++ b/quickwit/quickwit-serve/src/jaeger_api/rest_handler.rs @@ -201,7 +201,7 @@ async fn jaeger_traces_search( let result: Vec = spans .iter() - .map(|span| JaegerSpan::find_better_name_for_pb_convert(&span)) + .map(JaegerSpan::find_better_name_for_pb_convert) .group_by(|span| span.trace_id.clone()) .into_iter() .map(|(span_id, group)| JaegerTrace::new(span_id, group.collect_vec())) @@ -227,7 +227,7 @@ async fn jaeger_get_trace_by_id( let result: Vec = spans .iter() - .map(|span| JaegerSpan::find_better_name_for_pb_convert(&span)) + .map(JaegerSpan::find_better_name_for_pb_convert) .group_by(|span| span.trace_id.clone()) .into_iter() .map(|(span_id, group)| JaegerTrace::new(span_id, group.collect_vec())) diff --git a/quickwit/quickwit-serve/src/rest.rs b/quickwit/quickwit-serve/src/rest.rs index 553004b3cd1..251d0100082 100644 --- a/quickwit/quickwit-serve/src/rest.rs +++ b/quickwit/quickwit-serve/src/rest.rs @@ -608,6 +608,7 @@ mod tests { metastore_server_opt: None, node_config: Arc::new(node_config.clone()), search_service: Arc::new(MockSearchService::new()), + jaeger_service_opt: None, }; let handler = api_v1_routes(Arc::new(quickwit_services)); let resp = warp::test::request()