(
py: Python<'p>,
obj: &'a PyObject,
)
| 74 | |
| 75 | #[inline] |
| 76 | fn downcast_borrow_from<'a, 'p>( |
| 77 | py: Python<'p>, |
| 78 | obj: &'a PyObject, |
| 79 | ) -> Result<&'a PyString, PythonObjectDowncastError<'p>> { |
| 80 | unsafe { |
| 81 | if is_base_string(obj) { |
| 82 | Ok(std::mem::transmute(obj)) |
| 83 | } else { |
| 84 | Err(crate::python::PythonObjectDowncastError::new( |
| 85 | py, |
| 86 | "PyString", |
| 87 | obj.get_type(py), |
| 88 | )) |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | #[cfg(feature = "python27-sys")] |
nothing calls this directly
no test coverage detected