(&self, vm: &VirtualMachine)
| 22 | |
| 23 | pub trait ToCString: AsRef<Wtf8> { |
| 24 | fn to_cstring(&self, vm: &VirtualMachine) -> PyResult<alloc::ffi::CString> { |
| 25 | alloc::ffi::CString::new(self.as_ref().as_bytes()).map_err(|err| err.to_pyexception(vm)) |
| 26 | } |
| 27 | fn ensure_no_nul(&self, vm: &VirtualMachine) -> PyResult<()> { |
| 28 | if self.as_ref().as_bytes().contains(&b'\0') { |
| 29 | Err(cstring_error(vm)) |
nothing calls this directly
no test coverage detected