Implement Extend<Bytes> for BytesMut (#527)

This commit is contained in:
Rob Ede
2022-01-24 09:58:18 +01:00
committed by GitHub
parent 0e3b2466f1
commit 131dae161f
2 changed files with 18 additions and 0 deletions
+7
View File
@@ -544,6 +544,13 @@ fn extend_from_slice_mut() {
}
}
#[test]
fn extend_mut_from_bytes() {
let mut bytes = BytesMut::with_capacity(0);
bytes.extend([Bytes::from(LONG)]);
assert_eq!(*bytes, LONG[..]);
}
#[test]
fn extend_mut_without_size_hint() {
let mut bytes = BytesMut::with_capacity(0);