mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-26 02:46:30 +00:00
feat!: upgrade to matchit 0.8.0
(#140)
A copy of #134 but just with the matchit upgrade. Thank you @matiu2 for raising the original PR
This commit is contained in:
parent
cb083ad66e
commit
0bdb2b6ef4
3 changed files with 4 additions and 3 deletions
|
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Removed `task_local_extensions` in favour of `http::Extensions`.
|
||||
- All extensions must be `Clone` now.
|
||||
- Replaced `with_arc` and `with_arc_init` methods with `with_box` and `with_box_init`.
|
||||
- Support for `matchit` `0.8.0` - This means router matches like `/a/:some_var` need to be changed to `/a/{some_var}`
|
||||
|
||||
### Changed
|
||||
- `RequestBuilder::try_clone` now clones the extensions.
|
||||
|
|
|
@ -20,7 +20,7 @@ reqwest-middleware = { version = "0.3.0", path = "../reqwest-middleware" }
|
|||
|
||||
anyhow = "1.0.70"
|
||||
async-trait = "0.1.51"
|
||||
matchit = "0.7.3"
|
||||
matchit = "0.8.0"
|
||||
http = "1"
|
||||
reqwest = { version = "0.12.0", default-features = false }
|
||||
tracing = "0.1.26"
|
||||
|
|
|
@ -267,9 +267,9 @@ impl OtelPathNames {
|
|||
///
|
||||
/// ```
|
||||
/// # use reqwest_tracing::OtelPathNames;
|
||||
/// let path_names = OtelPathNames::known_paths(["/payment/:paymentId"]).unwrap();
|
||||
/// let path_names = OtelPathNames::known_paths(["/payment/{paymentId}"]).unwrap();
|
||||
/// let path = path_names.find("/payment/payment-id-123");
|
||||
/// assert_eq!(path, Some("/payment/:paymentId"));
|
||||
/// assert_eq!(path, Some("/payment/{paymentId}"));
|
||||
/// ```
|
||||
pub fn find(&self, path: &str) -> Option<&str> {
|
||||
self.0.at(path).map(|mtch| mtch.value.as_str()).ok()
|
||||
|
|
Loading…
Reference in a new issue