MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / test_extract_byte_str_to_vec

Function test_extract_byte_str_to_vec

src/objects/string.rs:612–618  ·  view source on GitHub ↗

only works with specialization

()

Source from the content-addressed store, hash-verified

610 #[test]
611 #[cfg(feature = "nightly")] // only works with specialization
612 fn test_extract_byte_str_to_vec() {
613 let gil = Python::acquire_gil();
614 let py = gil.python();
615 let py_bytes = py.eval("b'Hello'", None, None).unwrap();
616 let v = py_bytes.extract::<Vec<u8>>(py).unwrap();
617 assert_eq!(b"Hello", &v[..]);
618 }
619
620 #[allow(unused_variables)] // when compiling for py2.7
621 #[test]

Callers

nothing calls this directly

Calls 2

pythonMethod · 0.80
evalMethod · 0.80

Tested by

no test coverage detected