Add conversion from BytesMut to Vec<u8>
Fixed #427 

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
According to this thread https://github.com/tokio-rs/bytes/pull/151/commits/824a986fec988eaa7f9313838a01c7ff6d0e85bb conversion from `Bytes` to `Vec<u8>` has ever existed but not found today. Is it deleted? but what reason? Is there some workaround today?

I want to use `Bytes` entirely in my [library](https://github.com/akiradeveloper/lol). It is a Raft library using gRPC. To send RPC I need to make `Vec<u8>` as payload (I hope prost generates code using `Bytes` instead of `Vec<u8>` though), if there is no cost to extract `Vec<u8>` from `Bytes` when refcnt=1 that would push me forward to fully depend on `Bytes`.
Conversion from Bytes to Vec<u8>?
diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs
index 4f9a8851c..65f97b46e 100644
--- a/src/bytes_mut.rs
+++ b/src/bytes_mut.rs
@@ -1540,6 +1540,43 @@ impl PartialEq<Bytes> for BytesMut {
     }
 }
 
+impl From<BytesMut> for Vec<u8> {
+    fn from(mut bytes: BytesMut) -> Self {
+        let kind = bytes.kind();
+
+        let mut vec = if kind == KIND_VEC {
+            unsafe {
+                let (off, _) = bytes.get_vec_pos();
+                rebuild_vec(bytes.ptr.as_ptr(), bytes.len, bytes.cap, off)
+            }
+        } else if kind == KIND_ARC {
+            let shared = unsafe { &mut *(bytes.data as *mut Shared) };
+            if shared.is_unique() {
+                let vec = mem::replace(&mut shared.vec, Vec::new());
+
+                unsafe { release_shared(shared) };
+
+                vec
+            } else {
+                return bytes.deref().into();
+            }
+        } else {
+            return bytes.deref().into();
+        };
+
+        let len = bytes.len;
+
+        unsafe {
+            ptr::copy(bytes.ptr.as_ptr(), vec.as_mut_ptr(), len);
+            vec.set_len(len);
+        }
+
+        mem::forget(bytes);
+
+        vec
+    }
+}
+
 #[inline]
 fn vptr(ptr: *mut u8) -> NonNull<u8> {
     if cfg!(debug_assertions) {

diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs
index 68536770d..ef7512b77 100644
--- a/tests/test_bytes.rs
+++ b/tests/test_bytes.rs
@@ -1028,3 +1028,40 @@ fn box_slice_empty() {
     let b = Bytes::from(empty);
     assert!(b.is_empty());
 }
+
+#[test]
+fn bytes_into_vec() {
+    // Test kind == KIND_VEC
+    let content = b"helloworld";
+
+    let mut bytes = BytesMut::new();
+    bytes.put_slice(content);
+
+    let vec: Vec<u8> = bytes.into();
+    assert_eq!(&vec, content);
+
+    // Test kind == KIND_ARC, shared.is_unique() == True
+    let mut bytes = BytesMut::new();
+    bytes.put_slice(b"abcdewe23");
+    bytes.put_slice(content);
+
+    // Overwrite the bytes to make sure only one reference to the underlying
+    // Vec exists.
+    bytes = bytes.split_off(9);
+
+    let vec: Vec<u8> = bytes.into();
+    assert_eq!(&vec, content);
+
+    // Test kind == KIND_ARC, shared.is_unique() == False
+    let prefix = b"abcdewe23";
+
+    let mut bytes = BytesMut::new();
+    bytes.put_slice(prefix);
+    bytes.put_slice(content);
+
+    let vec: Vec<u8> = bytes.split_off(prefix.len()).into();
+    assert_eq!(&vec, content);
+
+    let vec: Vec<u8> = bytes.into();
+    assert_eq!(&vec, prefix);
+}

{"vectored_read": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_advance_arc": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_in_arc_nonunique_does_not_overallocate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_clone": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_empty_other": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "chain_get_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "copy_to_bytes_less": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_split_off": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_vec_recycling": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "take_copy_to_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "fmt": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "buf_read": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bufs_vec": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "from_slice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_in_arc_unique_does_not_overallocate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_empty_subslice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "from_iter_no_size_hint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_with_capacity_but_empty": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_truncate_and_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_vec_as_mut_buf": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_arc_different": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_get_u16": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_split_to": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_growth": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_deref_bufmut_forwards": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "writing_chained": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iterating_two_bufs": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_vec_deque": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "sanity_check_odd_allocator": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_layout": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "index": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_get_u8": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_to_1": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_mut_from_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_u8": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_from_slice_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off_to_loop": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_clone_unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "from_static": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "box_slice_empty": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_int_le": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_u16": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_into_vec": {"run": "NONE", "test": "NONE", "fix": "PASS"}, "split_to_2": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "partial_eq_bytesmut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_not_an_empty_subset": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_clone_drop": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_truncate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_in_arc_unique_doubles": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_truncate_arc": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "long_take": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_empty": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_clone_shared": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_truncate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "chain_overflow_remaining_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_empty_other_keeps_capacity": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "fmt_write": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "advance_bytes_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_max_original_capacity_value": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_allocates_at_least_original_capacity": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_mut_without_size_hint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_two_split_offs": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_slice_put_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_from_vec_drop": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_int": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "collect_two_bufs": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_works": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_arc_non_contiguous": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "fns_defined_for_bytes_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_deref_buf_forwards": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "read": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "advance_static": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_buf_mut_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iter_len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_vec_put_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "advance_vec": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "stress": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_other_keeps_capacity": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_fresh_cursor_vec": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "truncate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off_to_at_gt_len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_mut_slice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "empty_slice_ref_not_an_empty_subset": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_put_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "chain_growing_buffer": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bounds": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off_uninitialized": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_buf_mut_reuse_when_fully_consumed": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_basic": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "empty_iter_len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_shared_reuse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_convert": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_empty_self": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"vectored_read": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_advance_arc": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_in_arc_nonunique_does_not_overallocate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_clone": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_empty_other": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "chain_get_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "copy_to_bytes_less": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_split_off": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_vec_recycling": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "take_copy_to_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "fmt": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "buf_read": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bufs_vec": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "from_slice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_in_arc_unique_does_not_overallocate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_empty_subslice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "from_iter_no_size_hint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_with_capacity_but_empty": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_truncate_and_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_vec_as_mut_buf": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_arc_different": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_get_u16": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_split_to": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_growth": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_deref_bufmut_forwards": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "writing_chained": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iterating_two_bufs": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_vec_deque": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "sanity_check_odd_allocator": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_layout": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "index": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_get_u8": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_to_1": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_mut_from_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_u8": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_from_slice_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off_to_loop": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_clone_unique": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "from_static": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "box_slice_empty": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_int_le": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_u16": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_into_vec": {"run": "NONE", "test": "NONE", "fix": "PASS"}, "split_to_2": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "partial_eq_bytesmut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_not_an_empty_subset": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_clone_drop": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_truncate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_in_arc_unique_doubles": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_truncate_arc": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "long_take": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_empty": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_clone_shared": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "freeze_after_truncate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "chain_overflow_remaining_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_empty_other_keeps_capacity": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "fmt_write": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "advance_bytes_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_max_original_capacity_value": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_allocates_at_least_original_capacity": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "extend_mut_without_size_hint": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_two_split_offs": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_slice_put_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_from_vec_drop": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_put_int": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "collect_two_bufs": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "slice_ref_works": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_arc_non_contiguous": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "fns_defined_for_bytes_mut": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_deref_buf_forwards": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "read": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "advance_static": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_buf_mut_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "iter_len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_vec_put_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "advance_vec": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "stress": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_other_keeps_capacity": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_fresh_cursor_vec": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "truncate": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off_to_at_gt_len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_mut_slice": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "empty_slice_ref_not_an_empty_subset": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_put_bytes": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "chain_growing_buffer": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bounds": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "split_off_uninitialized": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_buf_mut_reuse_when_fully_consumed": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_basic": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "empty_iter_len": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_shared_reuse": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "test_bytes_advance": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "reserve_convert": {"run": "PASS", "test": "NONE", "fix": "PASS"}, "bytes_mut_unsplit_empty_self": {"run": "PASS", "test": "NONE", "fix": "PASS"}}
{"passed_count": 98, "failed_count": 0, "skipped_count": 0, "passed_tests": ["vectored_read", "freeze_after_advance_arc", "reserve_in_arc_nonunique_does_not_overallocate", "test_clone", "copy_to_bytes_less", "freeze_after_split_off", "reserve_vec_recycling", "fmt", "buf_read", "from_slice", "len", "slice_ref_empty_subslice", "from_iter_no_size_hint", "bytes_with_capacity_but_empty", "test_vec_as_mut_buf", "bytes_mut_unsplit_arc_different", "test_get_u16", "freeze_after_split_to", "reserve_growth", "test_vec_deque", "extend_from_slice_mut", "box_slice_empty", "test_put_u16", "split_to_2", "partial_eq_bytesmut", "slice_ref_not_an_empty_subset", "test_bytes_truncate", "freeze_clone_shared", "advance_bytes_mut", "reserve_max_original_capacity_value", "extend_mut_without_size_hint", "test_slice_put_bytes", "test_bytes_from_vec_drop", "slice_ref_works", "bytes_mut_unsplit_arc_non_contiguous", "fns_defined_for_bytes_mut", "test_deref_buf_forwards", "read", "advance_static", "bytes_buf_mut_advance", "iter_len", "test_fresh_cursor_vec", "split_off_to_at_gt_len", "empty_slice_ref_not_an_empty_subset", "bytes_put_bytes", "split_off_uninitialized", "bytes_buf_mut_reuse_when_fully_consumed", "bytes_mut_unsplit_basic", "reserve_shared_reuse", "test_bytes_advance", "bytes_mut_unsplit_empty_self", "bytes_mut_unsplit_empty_other", "freeze_after_advance", "chain_get_bytes", "take_copy_to_bytes", "test_bufs_vec", "reserve_in_arc_unique_does_not_overallocate", "test_bytes_truncate_and_advance", "slice", "test_deref_bufmut_forwards", "writing_chained", "iterating_two_bufs", "sanity_check_odd_allocator", "test_layout", "index", "test_get_u8", "split_to_1", "extend_mut_from_bytes", "test_put_u8", "split_off_to_loop", "freeze_clone_unique", "from_static", "test_put_int_le", "test_bytes_clone_drop", "reserve_in_arc_unique_doubles", "freeze_after_truncate_arc", "long_take", "slice_ref_empty", "freeze_after_truncate", "chain_overflow_remaining_mut", "bytes_mut_unsplit_empty_other_keeps_capacity", "fmt_write", "reserve_allocates_at_least_original_capacity", "extend_mut", "bytes_mut_unsplit_two_split_offs", "split_off", "test_put_int", "collect_two_bufs", "test_vec_put_bytes", "advance_vec", "stress", "bytes_mut_unsplit_other_keeps_capacity", "truncate", "test_mut_slice", "chain_growing_buffer", "test_bounds", "empty_iter_len", "reserve_convert"], "failed_tests": [], "skipped_tests": []}
{"passed_count": 0, "failed_count": 0, "skipped_count": 0, "passed_tests": [], "failed_tests": [], "skipped_tests": []}
{"passed_count": 99, "failed_count": 0, "skipped_count": 0, "passed_tests": ["vectored_read", "freeze_after_advance_arc", "reserve_in_arc_nonunique_does_not_overallocate", "test_clone", "copy_to_bytes_less", "freeze_after_split_off", "reserve_vec_recycling", "fmt", "buf_read", "from_slice", "len", "slice_ref_empty_subslice", "from_iter_no_size_hint", "bytes_with_capacity_but_empty", "test_vec_as_mut_buf", "bytes_mut_unsplit_arc_different", "test_get_u16", "freeze_after_split_to", "reserve_growth", "test_vec_deque", "extend_from_slice_mut", "box_slice_empty", "test_put_u16", "split_to_2", "partial_eq_bytesmut", "slice_ref_not_an_empty_subset", "test_bytes_truncate", "freeze_clone_shared", "advance_bytes_mut", "reserve_max_original_capacity_value", "extend_mut_without_size_hint", "test_slice_put_bytes", "test_bytes_from_vec_drop", "slice_ref_works", "bytes_mut_unsplit_arc_non_contiguous", "fns_defined_for_bytes_mut", "test_deref_buf_forwards", "read", "advance_static", "bytes_buf_mut_advance", "iter_len", "test_fresh_cursor_vec", "split_off_to_at_gt_len", "empty_slice_ref_not_an_empty_subset", "bytes_put_bytes", "split_off_uninitialized", "bytes_buf_mut_reuse_when_fully_consumed", "bytes_mut_unsplit_basic", "reserve_shared_reuse", "test_bytes_advance", "bytes_mut_unsplit_empty_self", "bytes_mut_unsplit_empty_other", "freeze_after_advance", "chain_get_bytes", "take_copy_to_bytes", "test_bufs_vec", "reserve_in_arc_unique_does_not_overallocate", "test_bytes_truncate_and_advance", "slice", "test_deref_bufmut_forwards", "writing_chained", "iterating_two_bufs", "sanity_check_odd_allocator", "test_layout", "index", "test_get_u8", "split_to_1", "extend_mut_from_bytes", "test_put_u8", "split_off_to_loop", "freeze_clone_unique", "from_static", "test_put_int_le", "bytes_into_vec", "test_bytes_clone_drop", "reserve_in_arc_unique_doubles", "freeze_after_truncate_arc", "long_take", "slice_ref_empty", "freeze_after_truncate", "chain_overflow_remaining_mut", "bytes_mut_unsplit_empty_other_keeps_capacity", "fmt_write", "reserve_allocates_at_least_original_capacity", "extend_mut", "bytes_mut_unsplit_two_split_offs", "split_off", "test_put_int", "collect_two_bufs", "test_vec_put_bytes", "advance_vec", "stress", "bytes_mut_unsplit_other_keeps_capacity", "truncate", "test_mut_slice", "chain_growing_buffer", "test_bounds", "empty_iter_len", "reserve_convert"], "failed_tests": [], "skipped_tests": []}