From 9c82a35a90a0d89469fb489ebcc8be12bd2f13b2 Mon Sep 17 00:00:00 2001 From: tl-rodrigo-gryzinski <73602926+tl-rodrigo-gryzinski@users.noreply.github.com> Date: Tue, 28 Sep 2021 19:50:23 +0100 Subject: [PATCH] chore: Move to task-local-extensions (#9) * chore: Move to task-local-extensions --- CHANGELOG.md | 1 + reqwest-middleware/Cargo.toml | 2 +- reqwest-middleware/src/client.rs | 2 +- reqwest-middleware/src/lib.rs | 2 +- reqwest-middleware/src/middleware.rs | 4 ++-- reqwest-retry/CHANGELOG.md | 1 + reqwest-retry/Cargo.toml | 2 +- reqwest-retry/src/middleware.rs | 2 +- reqwest-tracing/CHANGELOG.md | 1 + reqwest-tracing/Cargo.toml | 2 +- reqwest-tracing/src/middleware.rs | 2 +- 11 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80325dd..b880170 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Disabled default features on `reqwest` +- Replaced `truelayer-extensions` with `task-local-extensions` ### Added - New methods on `ClientWithExtensions` and `RequestBuilder` for sending requests with initial extensions. diff --git a/reqwest-middleware/Cargo.toml b/reqwest-middleware/Cargo.toml index 8e53070..629f4d3 100644 --- a/reqwest-middleware/Cargo.toml +++ b/reqwest-middleware/Cargo.toml @@ -18,7 +18,7 @@ http = "0.2" reqwest = { version = "0.11", default-features = false, features = ["json", "multipart"] } serde = "1" thiserror = "1" -truelayer-extensions = "0.1" +task-local-extensions = "0.1.1" [dev-dependencies] reqwest = "0.11" diff --git a/reqwest-middleware/src/client.rs b/reqwest-middleware/src/client.rs index 450e68a..add9747 100644 --- a/reqwest-middleware/src/client.rs +++ b/reqwest-middleware/src/client.rs @@ -6,7 +6,7 @@ use std::convert::TryFrom; use std::fmt::Display; use std::sync::Arc; use std::time::Duration; -use truelayer_extensions::Extensions; +use task_local_extensions::Extensions; use crate::error::Result; use crate::middleware::{Middleware, Next}; diff --git a/reqwest-middleware/src/lib.rs b/reqwest-middleware/src/lib.rs index efc0590..6432f67 100644 --- a/reqwest-middleware/src/lib.rs +++ b/reqwest-middleware/src/lib.rs @@ -8,7 +8,7 @@ //! ``` //! use reqwest::{Client, Request, Response}; //! use reqwest_middleware::{ClientBuilder, Middleware, Next, Result}; -//! use truelayer_extensions::Extensions; +//! use task_local_extensions::Extensions; //! //! struct LoggingMiddleware; //! diff --git a/reqwest-middleware/src/middleware.rs b/reqwest-middleware/src/middleware.rs index 926c601..4f6790e 100644 --- a/reqwest-middleware/src/middleware.rs +++ b/reqwest-middleware/src/middleware.rs @@ -1,7 +1,7 @@ use futures::future::{BoxFuture, FutureExt, TryFutureExt}; use reqwest::{Client, Request, Response}; use std::sync::Arc; -use truelayer_extensions::Extensions; +use task_local_extensions::Extensions; use crate::error::{Error, Result}; @@ -13,7 +13,7 @@ use crate::error::{Error, Result}; /// ``` /// use reqwest::{Client, Request, Response}; /// use reqwest_middleware::{ClientBuilder, Middleware, Next, Result}; -/// use truelayer_extensions::Extensions; +/// use task_local_extensions::Extensions; /// /// struct TransparentMiddleware; /// diff --git a/reqwest-retry/CHANGELOG.md b/reqwest-retry/CHANGELOG.md index 0308796..81bcfa9 100644 --- a/reqwest-retry/CHANGELOG.md +++ b/reqwest-retry/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Re-export `RetryPolicy` from the crate root. ### Changed - Disabled default features on `reqwest` +- Replaced `truelayer-extensions` with `task-local-extensions` ## [0.1.1] - 2021-09-15 ### Changed diff --git a/reqwest-retry/Cargo.toml b/reqwest-retry/Cargo.toml index 2395d7d..5962f69 100644 --- a/reqwest-retry/Cargo.toml +++ b/reqwest-retry/Cargo.toml @@ -21,7 +21,7 @@ retry-policies = "0.1" reqwest = { version = "0.11", default-features = false } tokio = { version = "1.6", features = ["time"] } tracing = "0.1.26" -truelayer-extensions = "0.1" +task-local-extensions = "0.1.1" [dev-dependencies] wiremock = "0.5" diff --git a/reqwest-retry/src/middleware.rs b/reqwest-retry/src/middleware.rs index cbbe930..7f036ff 100644 --- a/reqwest-retry/src/middleware.rs +++ b/reqwest-retry/src/middleware.rs @@ -6,7 +6,7 @@ use chrono::Utc; use reqwest::{Request, Response}; use reqwest_middleware::{Error, Middleware, Next, Result}; use retry_policies::RetryPolicy; -use truelayer_extensions::Extensions; +use task_local_extensions::Extensions; /// We limit the number of retries to a maximum of `10` to avoid stack-overflow issues due to the recursion. static MAXIMUM_NUMBER_OF_RETRIES: u32 = 10; diff --git a/reqwest-tracing/CHANGELOG.md b/reqwest-tracing/CHANGELOG.md index bb4cd84..c2a96de 100644 --- a/reqwest-tracing/CHANGELOG.md +++ b/reqwest-tracing/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Disabled default features on `reqwest` +- Replaced `truelayer-extensions` with `task-local-extensions` ## [0.1.2] - 2021-09-15 ### Changed diff --git a/reqwest-tracing/Cargo.toml b/reqwest-tracing/Cargo.toml index aef5145..401d3ea 100644 --- a/reqwest-tracing/Cargo.toml +++ b/reqwest-tracing/Cargo.toml @@ -22,7 +22,7 @@ async-trait = "0.1.51" reqwest = { version = "0.11", default-features = false } tokio = { version = "1.6", features = ["time"] } tracing = "0.1.26" -truelayer-extensions = "0.1" +task-local-extensions = "0.1.1" opentelemetry_0_13_pkg = { package = "opentelemetry", version = "0.13", optional = true } opentelemetry_0_14_pkg = { package = "opentelemetry", version = "0.14", optional = true } diff --git a/reqwest-tracing/src/middleware.rs b/reqwest-tracing/src/middleware.rs index da41302..0520ad0 100644 --- a/reqwest-tracing/src/middleware.rs +++ b/reqwest-tracing/src/middleware.rs @@ -1,7 +1,7 @@ use reqwest::header::{HeaderMap, HeaderValue}; use reqwest::{Request, Response, StatusCode as RequestStatusCode}; use reqwest_middleware::{Error, Middleware, Next, Result}; -use truelayer_extensions::Extensions; +use task_local_extensions::Extensions; /// Middleware for tracing requests using the current Opentelemetry Context. pub struct TracingMiddleware;