aboutsummaryrefslogtreecommitdiff
path: root/src/recv.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/recv.rs')
-rw-r--r--src/recv.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/recv.rs b/src/recv.rs
index f5221e6..abe7b9a 100644
--- a/src/recv.rs
+++ b/src/recv.rs
@@ -2,6 +2,7 @@ use std::collections::HashMap;
use std::sync::Arc;
use async_trait::async_trait;
+use bytes::Bytes;
use log::trace;
use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
@@ -85,7 +86,7 @@ pub(crate) trait RecvLoop: Sync + 'static {
let mut next_slice = vec![0; size as usize];
read.read_exact(&mut next_slice[..]).await?;
trace!("recv_loop: read {} bytes", next_slice.len());
- Ok(next_slice)
+ Ok(Bytes::from(next_slice))
};
let mut sender = if let Some(send) = streams.remove(&(id)) {