Skip to content

Commit

Permalink
fix(common): revert MSRV to 1.49 (#827)
Browse files Browse the repository at this point in the history
* fix(msrv): revert MSRV to 1.49

* fix: format
  • Loading branch information
TommyCpp authored Jun 29, 2022
1 parent b5c3ec6 commit 103ed3a
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.55.0
toolchain: 1.49
override: true
- name: Run tests
run: cargo --version &&
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.55+][msrv]*
*Compiler support: [requires `rustc` 1.49+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down Expand Up @@ -130,7 +130,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.55. 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
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"
fnv = { version = "1.0", optional = true }
futures-channel = "0.3"
futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] }
indexmap = "1.8"
indexmap = "=1.8"
once_cell = "1.12.0"
pin-project = { version = "1.0.2", optional = true }
thiserror = "1"
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.55+][msrv]*
*Compiler support: [requires `rustc` 1.49+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! services to capture distributed traces and metrics from your application. You
//! can analyze them using [Prometheus], [Jaeger], and other observability tools.
//!
//! *Compiler support: [requires `rustc` 1.55+][msrv]*
//! *Compiler support: [requires `rustc` 1.49+][msrv]*
//!
//! [Prometheus]: https://prometheus.io
//! [Jaeger]: https://www.jaegertracing.io
Expand Down
30 changes: 16 additions & 14 deletions opentelemetry-api/src/trace/order_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,15 @@ where
}
}

impl<K, V, const N: usize> From<[(K, V); N]> for OrderMap<K, V, RandomState>
where
K: Hash + Eq,
{
fn from(arr: [(K, V); N]) -> Self {
Self(IndexMap::from(arr))
}
}
// todo: uncomment when the MSRV bumps
// impl<K, V, const N: usize> From<[(K, V); N]> for OrderMap<K, V, RandomState>
// where
// K: Hash + Eq,
// {
// fn from(arr: [(K, V); N]) -> Self {
// Self(IndexMap::from(arr))
// }
// }

impl<K, V, S> Extend<(K, V)> for OrderMap<K, V, S>
where
Expand Down Expand Up @@ -641,12 +642,13 @@ where
}
}

impl<const N: usize> From<[KeyValue; N]> for OrderMap<Key, Value, RandomState> {
fn from(arr: [KeyValue; N]) -> Self {
let arr = arr.map(|kv| (kv.key, kv.value));
Self(IndexMap::from(arr))
}
}
// todo: uncomment below when bumping MSRV
// impl<const N: usize> From<[KeyValue; N]> for OrderMap<Key, Value, RandomState> {
// fn from(arr: [KeyValue; N]) -> Self {
// let arr = arr.map(|kv| (kv.key, kv.value));
// Self(IndexMap::from(arr))
// }
// }

impl<S> Extend<KeyValue> for OrderMap<Key, Value, S>
where
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-datadog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ surf-client = ["surf", "opentelemetry-http/surf"]

[dependencies]
async-trait = "0.1"
indexmap = "1.6"
indexmap = "=1.8"
once_cell = "1.12"
opentelemetry = { version = "0.17", path = "../opentelemetry", features = ["trace"] }
opentelemetry-http = { version = "0.6", path = "../opentelemetry-http" }
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ analysis in order to understand your software's performance and behavior. This
crate provides a HTTP client interface for use by trace exporters, as well as
helper types to inject and extract key value pairs into/from HTTP headers.

*Compiler support: [requires `rustc` 1.55+][msrv]*
*Compiler support: [requires `rustc` 1.49+][msrv]*

[`OpenTelemetry`]: https://crates.io/crates/opentelemetry
[msrv]: #supported-rust-versions

## Supported Rust Versions

OpenTelemetry is built against the latest stable release. The minimum supported
version is 1.55. 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
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ analysis in order to understand your software's performance and behavior. This
crate provides a trace pipeline and exporter for sending span information to a
Jaeger `agent` or `collector` endpoint for processing and visualization.

*Compiler support: [requires `rustc` 1.55+][msrv]*
*Compiler support: [requires `rustc` 1.49+][msrv]*

[`Jaeger`]: https://www.jaegertracing.io/
[`OpenTelemetry`]: https://crates.io/crates/opentelemetry
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-jaeger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! See the [Jaeger Docs] for details about Jaeger and deployment information.
//!
//! *Compiler support: [requires `rustc` 1.55+][msrv]*
//! *Compiler support: [requires `rustc` 1.49+][msrv]*
//!
//! [Jaeger Docs]: https://www.jaegertracing.io/docs/
//! [msrv]: #supported-rust-versions
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"
async-std = { version = "= 1.10.0", features = ["unstable"], optional = true }
async-trait = { version = "0.1", optional = true }
crossbeam-channel = { version = "0.5", optional = true }
dashmap = { version = "5.3.4", optional = true }
dashmap = { version = "=5.1.0", optional = true }
fnv = { version = "1.0", optional = true }
futures-channel = "0.3"
futures-executor = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.55+][msrv]*
*Compiler support: [requires `rustc` 1.49+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-zipkin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ futures-core = "0.3"
[dev-dependencies]
bytes = "1"
futures-util = { version = "0.3", features = ["io"] }
isahc = "1.4"
hyper = "0.14"
opentelemetry = { default-features = false, features = ["trace", "testing"], path = "../opentelemetry" }
4 changes: 2 additions & 2 deletions opentelemetry-zipkin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ analysis in order to understand your software's performance and behavior. This
crate provides a trace pipeline and exporter for sending span information to a
Zipkin collector for processing and visualization.

*Compiler support: [requires `rustc` 1.55+][msrv]*
*Compiler support: [requires `rustc` 1.49+][msrv]*

[`Zipkin`]: https://zipkin.io/
[`OpenTelemetry`]: https://crates.io/crates/opentelemetry
Expand Down Expand Up @@ -107,7 +107,7 @@ available so be sure to match them appropriately.
## Supported Rust Versions

OpenTelemetry is built against the latest stable release. The minimum supported
version is 1.55. The current OpenTelemetry version is not guaranteed to build on
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 before
Expand Down
34 changes: 21 additions & 13 deletions opentelemetry-zipkin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Collects OpenTelemetry spans and reports them to a given Zipkin collector
//! endpoint. See the [Zipkin Docs] for details and deployment information.
//!
//! *Compiler support: [requires `rustc` 1.55+][msrv]*
//! *Compiler support: [requires `rustc` 1.49+][msrv]*
//!
//! [Zipkin Docs]: https://zipkin.io/
//! [msrv]: #supported-rust-versions
Expand Down Expand Up @@ -98,31 +98,39 @@
//! use http::{Request, Response};
//! use std::convert::TryInto as _;
//! use std::error::Error;
//! use hyper::{client::HttpConnector, Body};
//!
//! // `reqwest` and `surf` are supported through features, if you prefer an
//! // alternate http client you can add support by implementing `HttpClient` as
//! // shown here.
//! #[derive(Debug)]
//! struct IsahcClient(isahc::HttpClient);
//! struct HyperClient(hyper::Client<HttpConnector, Body>);
//!
//! #[async_trait]
//! impl HttpClient for IsahcClient {
//! async fn send(&self, request: Request<Vec<u8>>) -> Result<Response<Bytes>, HttpError> {
//! let mut response = self.0.send_async(request).await?;
//! let status = response.status();
//! let mut bytes = Vec::with_capacity(response.body().len().unwrap_or(0).try_into()?);
//! isahc::AsyncReadResponseExt::copy_to(&mut response, &mut bytes).await?;
//!
//! Ok(Response::builder()
//! .status(response.status())
//! .body(bytes.into())?)
//! impl HttpClient for HyperClient {
//! async fn send(&self, req: Request<Vec<u8>>) -> Result<Response<Bytes>, HttpError> {
//! let resp = self
//! .0
//! .request(req.map(|v| Body::from(v)))
//! .await?;
//!
//! let response = Response::builder()
//! .status(resp.status())
//! .body({
//! hyper::body::to_bytes(resp.into_body())
//! .await
//! .expect("cannot decode response")
//! })
//! .expect("cannot build response");
//!
//! Ok(response)
//! }
//! }
//!
//! fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
//! global::set_text_map_propagator(opentelemetry_zipkin::Propagator::new());
//! let tracer = opentelemetry_zipkin::new_pipeline()
//! .with_http_client(IsahcClient(isahc::HttpClient::new()?))
//! .with_http_client(HyperClient(hyper::Client::new()))
//! .with_service_name("my_app")
//! .with_service_address("127.0.0.1:8080".parse()?)
//! .with_collector_endpoint("http://localhost:9411/api/v2/spans")
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ analysis in order to understand your software's performance and behavior. You
can export and analyze them using [Prometheus], [Jaeger], and other
observability tools.

*Compiler support: [requires `rustc` 1.55+][msrv]*
*Compiler support: [requires `rustc` 1.49+][msrv]*

[Prometheus]: https://prometheus.io
[Jaeger]: https://www.jaegertracing.io
Expand Down Expand Up @@ -130,7 +130,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.55. 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
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! services to capture distributed traces and metrics from your application. You
//! can analyze them using [Prometheus], [Jaeger], and other observability tools.
//!
//! *Compiler support: [requires `rustc` 1.55+][msrv]*
//! *Compiler support: [requires `rustc` 1.49+][msrv]*
//!
//! [Prometheus]: https://prometheus.io
//! [Jaeger]: https://www.jaegertracing.io
Expand Down

0 comments on commit 103ed3a

Please sign in to comment.