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

Method utf32_bytes

src/objects/string.rs:187–189  ·  view source on GitHub ↗
(input: &[u32])

Source from the content-addressed store, hash-verified

185 }
186 PyStringData::Utf32(data) => {
187 fn utf32_bytes(input: &[u32]) -> &[u8] {
188 unsafe { mem::transmute(input) }
189 }
190 match data.iter().map(|&u| char::from_u32(u)).collect() {
191 Some(s) => Ok(Cow::Owned(s)),
192 None => Err(PyErr::from_instance(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected