From 6c195d85215b31f280e1f21399c2643e7bff922c Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 1 Apr 2019 10:26:25 -0700 Subject: [PATCH] add Derev for ClientRequest --- awc/CHANGES.md | 8 ++++++++ awc/src/request.rs | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/awc/CHANGES.md b/awc/CHANGES.md index e0e83214..6e472035 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -1,5 +1,13 @@ # Changes + +## [0.1.0-alpha.3] - 2019-04-xx + +### Added + +* Added `Deref` for `ClientRequest`. + + ## [0.1.0-alpha.2] - 2019-03-29 ### Added diff --git a/awc/src/request.rs b/awc/src/request.rs index a462479e..f732657d 100644 --- a/awc/src/request.rs +++ b/awc/src/request.rs @@ -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 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { writeln!(