From b896b0b5cd8855a12ba5f2ab7fa123f6172bc3e9 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 9 Sep 2024 09:53:02 -0700 Subject: [PATCH 1/5] msrv patch tokio-stream --- scripts/patch_dependencies.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/patch_dependencies.sh b/scripts/patch_dependencies.sh index f130267fde..f9c30fbe87 100755 --- a/scripts/patch_dependencies.sh +++ b/scripts/patch_dependencies.sh @@ -10,3 +10,5 @@ patch_version cc 1.0.105 patch_version url 2.5.0 patch_version hyper-rustls 0.27.2 # 0.27.3 needs rustc v1.70.0 patch_version tokio-util 0.7.11 # 0.7.12 needs rustc v1.70.0 +patch_version tokio-stream 0.1.15 # 0.1.15 needs rustc v1.70.0 + From 611ba12633faa7e3224fead8a0b454f7b3ebf0a5 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 9 Sep 2024 09:56:35 -0700 Subject: [PATCH 2/5] comment --- scripts/patch_dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/patch_dependencies.sh b/scripts/patch_dependencies.sh index f9c30fbe87..e1e040be90 100755 --- a/scripts/patch_dependencies.sh +++ b/scripts/patch_dependencies.sh @@ -10,5 +10,5 @@ patch_version cc 1.0.105 patch_version url 2.5.0 patch_version hyper-rustls 0.27.2 # 0.27.3 needs rustc v1.70.0 patch_version tokio-util 0.7.11 # 0.7.12 needs rustc v1.70.0 -patch_version tokio-stream 0.1.15 # 0.1.15 needs rustc v1.70.0 +patch_version tokio-stream 0.1.15 # 0.1.16 needs rustc v1.70.0 From 675ca6e5a1d07b683463823233223f027912671e Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 9 Sep 2024 10:53:36 -0700 Subject: [PATCH 3/5] further lint changes --- examples/self-diagnostics/src/main.rs | 1 - opentelemetry-sdk/src/metrics/view.rs | 2 +- stress/src/throughput.rs | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/self-diagnostics/src/main.rs b/examples/self-diagnostics/src/main.rs index 04cd1fcd45..b9e6ebd490 100644 --- a/examples/self-diagnostics/src/main.rs +++ b/examples/self-diagnostics/src/main.rs @@ -12,7 +12,6 @@ use once_cell::sync::Lazy; use std::collections::HashSet; use std::sync::{Arc, Mutex}; -use ctrlc; use std::sync::mpsc::channel; struct ErrorState { diff --git a/opentelemetry-sdk/src/metrics/view.rs b/opentelemetry-sdk/src/metrics/view.rs index 8184613589..d9f256bd2b 100644 --- a/opentelemetry-sdk/src/metrics/view.rs +++ b/opentelemetry-sdk/src/metrics/view.rs @@ -107,7 +107,7 @@ pub fn new_view(criteria: Instrument, mask: Stream) -> Result> { ))); return Ok(Box::new(empty_view)); } - let contains_wildcard = criteria.name.contains(|c| c == '*' || c == '?'); + let contains_wildcard = criteria.name.contains(['*', '?']); let err_msg_criteria = criteria.clone(); let match_fn: Box bool + Send + Sync> = if contains_wildcard { diff --git a/stress/src/throughput.rs b/stress/src/throughput.rs index 41d790eea4..c77832a33c 100644 --- a/stress/src/throughput.rs +++ b/stress/src/throughput.rs @@ -36,7 +36,7 @@ where if let Some(arg_str) = args_iter.nth(1) { let arg = arg_str.parse::(); - if !arg.is_ok() { + if arg.is_err() { eprintln!("Invalid command line argument '{}' as number of threads. Make sure the value is a positive integer.", arg_str); std::process::exit(1); } @@ -50,7 +50,7 @@ where arg_num, num_threads ); } - num_threads = arg_num as usize; + num_threads = arg_num; } else { eprintln!("Invalid command line argument {} as number of threads. Make sure the value is above 0 and less than or equal to number of available logical cores ({}).", arg_num, num_threads); std::process::exit(1); From 0c2306c7f04be16d14f5811e9ce22c3ee9a3473b Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 9 Sep 2024 10:59:06 -0700 Subject: [PATCH 4/5] more lint --- opentelemetry-zipkin/src/exporter/model/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-zipkin/src/exporter/model/mod.rs b/opentelemetry-zipkin/src/exporter/model/mod.rs index 67f3a73767..c1a1dc2db0 100644 --- a/opentelemetry-zipkin/src/exporter/model/mod.rs +++ b/opentelemetry-zipkin/src/exporter/model/mod.rs @@ -37,7 +37,7 @@ pub(crate) fn into_zipkin_span(local_endpoint: Endpoint, span_data: SpanData) -> span_data .attributes .into_iter() - .map(|kv| { + .inspect(|kv| { if kv.key == Key::new("span.kind") { user_defined_span_kind = true; } From b1858d64a867ae6fac9c2eef62054208824121bd Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 9 Sep 2024 11:05:12 -0700 Subject: [PATCH 5/5] lint.. --- opentelemetry-zipkin/src/exporter/model/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/opentelemetry-zipkin/src/exporter/model/mod.rs b/opentelemetry-zipkin/src/exporter/model/mod.rs index c1a1dc2db0..b143848f31 100644 --- a/opentelemetry-zipkin/src/exporter/model/mod.rs +++ b/opentelemetry-zipkin/src/exporter/model/mod.rs @@ -41,7 +41,6 @@ pub(crate) fn into_zipkin_span(local_endpoint: Endpoint, span_data: SpanData) -> if kv.key == Key::new("span.kind") { user_defined_span_kind = true; } - kv }) .chain( [