aboutsummaryrefslogtreecommitdiff
path: root/src/proto.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/proto.rs')
-rw-r--r--src/proto.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/proto.rs b/src/proto.rs
index ca1a3d2..073a317 100644
--- a/src/proto.rs
+++ b/src/proto.rs
@@ -151,9 +151,10 @@ impl Stream for DataReader {
}
let mut body = [0; MAX_CHUNK_LENGTH as usize];
- body[..buf.len()].copy_from_slice(&buf);
+ let len = buf.len();
+ body[..len].copy_from_slice(buf);
buf.clear();
- Poll::Ready(Some((body, MAX_CHUNK_LENGTH as usize)))
+ Poll::Ready(Some((body, len)))
}
}
}