aboutsummaryrefslogtreecommitdiff
path: root/src/message.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-22 13:32:08 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-22 13:32:08 +0200
commitb9df442f035e6648e80adf8f9bf86b4943508ae5 (patch)
tree7c1c7179cb2c06f944476e6d9518ee88f37752a3 /src/message.rs
parent50627c206043edf5ce8755893944a6f17a54fb85 (diff)
downloadnetapp-b9df442f035e6648e80adf8f9bf86b4943508ae5.tar.gz
netapp-b9df442f035e6648e80adf8f9bf86b4943508ae5.zip
Small optimization
Diffstat (limited to 'src/message.rs')
-rw-r--r--src/message.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/message.rs b/src/message.rs
index ba06551..0ac4cb8 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -81,6 +81,10 @@ impl<M: Message> Req<M> {
}
}
+ pub fn take_stream(&mut self) -> Option<ByteStream> {
+ std::mem::replace(&mut self.body, BodyData::None).into_stream()
+ }
+
pub(crate) fn into_enc(
self,
prio: RequestPriority,