mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-26 02:46:30 +00:00
Use new matchit syntax in documentation (#181)
* Use new matchit syntax in documentation * Fix link in GitHub pull request template
This commit is contained in:
parent
211a6dea9f
commit
cf06f0962a
2 changed files with 5 additions and 5 deletions
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -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`
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue