(&self, py: Python)
| 273 | |
| 274 | #[cfg(feature = "python27-sys")] |
| 275 | fn data_impl(&self, py: Python) -> PyStringData { |
| 276 | if let Ok(bytes) = self.0.cast_as::<PyBytes>(py) { |
| 277 | PyStringData::Utf8(bytes.data(py)) |
| 278 | } else if let Ok(unicode) = self.0.cast_as::<PyUnicode>(py) { |
| 279 | unicode.data(py) |
| 280 | } else { |
| 281 | panic!("PyString is neither `str` nor `unicode`") |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | #[cfg(feature = "python3-sys")] |
| 286 | fn data_impl(&self, _py: Python) -> PyStringData { |
no test coverage detected