Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions reqwest-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed wasm32 by disabling incompatible parts. On that target, `ClientWithMiddleware` is no longer
a Tower service and has no `ClientWithMiddleware::timeout` function.

- Implemented `AsRef<Client>` for `ClientWithMiddleware`. Allows access to the inner `reqwest::Client` ([#209](https://github.com/TrueLayer/reqwest-middleware/pull/209))

## [0.4.0] - 2024-11-08

### Breaking Changes
Expand Down
9 changes: 9 additions & 0 deletions reqwest-middleware/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ impl fmt::Debug for ClientWithMiddleware {
}
}

// Implementing AsRef<Client> for ClientWithMiddleware.
//
// This allows to use ClientWithMiddleware as a reqwest::Client.
impl AsRef<Client> for ClientWithMiddleware {
fn as_ref(&self) -> &Client {
&self.inner
}
}

#[cfg(not(target_arch = "wasm32"))]
mod service {
use std::{
Expand Down
Loading