MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_from_bytes

Function test_from_bytes

arrow-buffer/src/bytes.rs:252–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250
251 #[test]
252 fn test_from_bytes() {
253 let message = b"hello arrow";
254
255 // we can create a Bytes from bytes::Bytes (created from slices)
256 let c_bytes: bytes::Bytes = message.as_ref().into();
257 let a_bytes: Bytes = c_bytes.into();
258 assert_eq!(a_bytes.as_slice(), message);
259
260 // we can create a Bytes from bytes::Bytes (created from Vec)
261 let c_bytes: bytes::Bytes = bytes::Bytes::from(message.to_vec());
262 let a_bytes: Bytes = c_bytes.into();
263 assert_eq!(a_bytes.as_slice(), message);
264 }
265
266 #[cfg(feature = "pool")]
267 mod pool_tests {

Callers

nothing calls this directly

Calls 1

as_refMethod · 0.45

Tested by

no test coverage detected