Commit 9df97060 authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

Use append in place of extend_from_slice in DataReaderImpl::add_data.

Suggested by @cheako.
parent a1758644
Pipeline #14828 passed with stages
in 15 minutes and 1 second
......@@ -418,7 +418,7 @@ impl DataReaderImpl {
}
/// Add the data from `d` to the end of our pending bytes.
fn add_data(&mut self, d: Vec<u8>) {
fn add_data(&mut self, mut d: Vec<u8>) {
if self.buf_is_empty() {
// No data pending? Just take d as the new pending.
self.pending = d;
......@@ -427,7 +427,7 @@ impl DataReaderImpl {
// XXXX This has potential to grow `pending` without
// bound. Fortunately, we don't read data in this
// (non-empty) case right now.
self.pending.extend_from_slice(&d[..]);
self.pending.append(&mut d);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment