Skip to content

Commit

Permalink
Use new matchit syntax in documentation (#181)
Browse files Browse the repository at this point in the history
* Use new matchit syntax in documentation

* Fix link in GitHub pull request template
  • Loading branch information
cstyles authored Aug 28, 2024
1 parent 211a6de commit cf06f09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
8 changes: 4 additions & 4 deletions reqwest-tracing/src/reqwest_otel_span_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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(())
Expand All @@ -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>
Expand Down

0 comments on commit cf06f09

Please sign in to comment.