Use new matchit syntax in documentation (#181)

* Use new matchit syntax in documentation

* Fix link in GitHub pull request template
main
Collin Styles 2024-08-28 14:37:51 -07:00 committed by GitHub
parent 211a6dea9f
commit cf06f0962a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@
<!--
Please, make sure:
- you have read the contributing guidelines:
https://github.com/TrueLayer/reqwest-middleware/blob/main/docs/CONTRIBUTING.md
https://github.com/TrueLayer/reqwest-middleware/blob/main/CONTRIBUTING.md
- you have formatted the code using rustfmt:
https://github.com/rust-lang/rustfmt
- you have checked that all tests pass, by running `cargo test --all`

View File

@ -248,7 +248,7 @@ pub struct OtelName(pub Cow<'static, str>);
/// let reqwest_client = reqwest::Client::builder().build()?;
/// let client = ClientBuilder::new(reqwest_client)
/// // Inserts the extension before the request is started
/// .with_init(Extension(OtelPathNames::known_paths(["/payment/:paymentId"])?))
/// .with_init(Extension(OtelPathNames::known_paths(["/payment/{paymentId}"])?))
/// // Makes use of that extension to specify the otel name
/// .with(TracingMiddleware::default())
/// .build();
@ -257,7 +257,7 @@ pub struct OtelName(pub Cow<'static, str>);
///
/// // Or specify it on the individual request (will take priority)
/// let resp = client.post("https://api.truelayer.com/payment/id-123/authorization-flow")
/// .with_extension(OtelPathNames::known_paths(["/payment/:paymentId/authorization-flow"])?)
/// .with_extension(OtelPathNames::known_paths(["/payment/{paymentId}/authorization-flow"])?)
/// .send()
/// .await?;
/// # Ok(())
@ -279,8 +279,8 @@ impl OtelPathNames {
/// OtelPathNames::known_paths([
/// "/",
/// "/payment",
/// "/payment/:paymentId",
/// "/payment/:paymentId/*action",
/// "/payment/{paymentId}",
/// "/payment/{paymentId}/*action",
/// ]).unwrap();
/// ```
pub fn known_paths<Paths, Path>(paths: Paths) -> anyhow::Result<Self>