From 73511ac8be380231d1146ce6fb3ac751b82b498b Mon Sep 17 00:00:00 2001 From: Greedwolf DSS Date: Wed, 17 Jan 2018 03:52:56 +0800 Subject: [PATCH] docs(example): fix send file to only send range of buffer read into --- examples/send_file.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/send_file.rs b/examples/send_file.rs index 68bc1197..c085ec10 100644 --- a/examples/send_file.rs +++ b/examples/send_file.rs @@ -103,7 +103,7 @@ impl Service for ResponseExamples { tx_body.close().expect("panic closing"); break; } else { - let chunk: Chunk = buf.to_vec().into(); + let chunk: Chunk = buf[0..n].to_vec().into(); match tx_body.send(Ok(chunk)).wait() { Ok(t) => { tx_body = t; }, Err(_) => { break; }