1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +01:00

add Derev<Target=RequestHead> for ClientRequest

This commit is contained in:
Nikolay Kim 2019-04-01 10:26:25 -07:00
parent 96fd61f3d5
commit 6c195d8521
2 changed files with 22 additions and 0 deletions

View File

@ -1,5 +1,13 @@
# Changes # Changes
## [0.1.0-alpha.3] - 2019-04-xx
### Added
* Added `Deref<Target = RequestHead>` for `ClientRequest`.
## [0.1.0-alpha.2] - 2019-03-29 ## [0.1.0-alpha.2] - 2019-03-29
### Added ### Added

View File

@ -554,6 +554,20 @@ impl ClientRequest {
} }
} }
impl std::ops::Deref for ClientRequest {
type Target = RequestHead;
fn deref(&self) -> &RequestHead {
&self.head
}
}
impl std::ops::DerefMut for ClientRequest {
fn deref_mut(&mut self) -> &mut RequestHead {
&mut self.head
}
}
impl fmt::Debug for ClientRequest { impl fmt::Debug for ClientRequest {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
writeln!( writeln!(