diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46e4ce34a3..664c8cd540 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.46.0 + toolchain: 1.49.0 override: true - name: Run tests run: cargo --version && diff --git a/README.md b/README.md index 1c3ef2e049..2682d10aae 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ above, please let us know! We'd love to add your project to the list! ## Supported Rust Versions OpenTelemetry is built against the latest stable release. The minimum supported -version is 1.46. The current OpenTelemetry version is not guaranteed to build +version is 1.49. The current OpenTelemetry version is not guaranteed to build on Rust versions earlier than the minimum supported version. The current stable Rust compiler and the three most recent minor versions diff --git a/opentelemetry-datadog/src/lib.rs b/opentelemetry-datadog/src/lib.rs index b97db7806e..49bdcef9a5 100644 --- a/opentelemetry-datadog/src/lib.rs +++ b/opentelemetry-datadog/src/lib.rs @@ -199,13 +199,15 @@ mod propagator { } fn extract_trace_id(&self, trace_id: &str) -> Result { - u64::from_str_radix(trace_id, 10) + trace_id + .parse::() .map(|id| TraceId::from_u128(id as u128)) .map_err(|_| ExtractError::TraceId) } fn extract_span_id(&self, span_id: &str) -> Result { - u64::from_str_radix(span_id, 10) + span_id + .parse::() .map(SpanId::from_u64) .map_err(|_| ExtractError::SpanId) } @@ -214,7 +216,8 @@ mod propagator { &self, sampling_priority: &str, ) -> Result { - let i = i32::from_str_radix(sampling_priority, 10) + let i = sampling_priority + .parse::() .map_err(|_| ExtractError::SamplingPriority)?; match i { diff --git a/opentelemetry-otlp/tests/grpc_build.rs b/opentelemetry-otlp/tests/grpc_build.rs index 021f13d1e2..a912264ef1 100644 --- a/opentelemetry-otlp/tests/grpc_build.rs +++ b/opentelemetry-otlp/tests/grpc_build.rs @@ -40,18 +40,17 @@ fn build_grpc() { } fn build_content_map() -> HashMap { - let mut map = HashMap::new(); - let dict = - std::fs::read_dir("src/proto/grpcio").expect("cannot open dict of generated grpc files"); - for entry in dict { - if let Ok(entry) = entry { - map.insert( + std::fs::read_dir("src/proto/grpcio") + .expect("cannot open dict of generated grpc files") + .into_iter() + .flatten() + .map(|entry| { + ( entry.path(), std::fs::read_to_string(entry.path()).unwrap_or_else(|_| { panic!("cannot read from file {}", entry.path().to_string_lossy()) }), - ); - } - } - map + ) + }) + .collect() }