MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / to_vec_copies

Function to_vec_copies

nodedb/src/data/io/aligned_buf.rs:124–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123 #[test]
124 fn to_vec_copies() {
125 let mut buf = AlignedBuf::new(4096).unwrap();
126 let data = b"test data";
127 unsafe {
128 std::ptr::copy_nonoverlapping(data.as_ptr(), buf.as_mut_ptr(), data.len());
129 let v = buf.to_vec(data.len());
130 assert_eq!(v, data);
131 }
132 }
133}

Callers

nothing calls this directly

Calls 4

as_ptrMethod · 0.45
as_mut_ptrMethod · 0.45
lenMethod · 0.45
to_vecMethod · 0.45

Tested by

no test coverage detected