We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42aff87 commit cd03960Copy full SHA for cd03960
src/common/buf.rs
@@ -75,11 +75,7 @@ impl<T: Buf> Buf for BufList<T> {
75
// Our inner buffer may have an optimized version of copy_to_bytes, and if the whole
76
// request can be fulfilled by the front buffer, we can take advantage.
77
match self.bufs.front_mut() {
78
- Some(front) if front.remaining() == len => {
79
- let b = front.copy_to_bytes(len);
80
- self.bufs.pop_front();
81
- b
82
- }
+ Some(front) if front.remaining() == len => self.bytes.pop_front().unwrap(),
83
Some(front) if front.remaining() > len => front.copy_to_bytes(len),
84
_ => {
85
assert!(len <= self.remaining(), "`len` greater than remaining");
0 commit comments