(py: Python, s: &str)
| 245 | pub fn new(py: Python, s: &str) -> PyString { |
| 246 | #[cfg(feature = "python27-sys")] |
| 247 | fn new_impl(py: Python, s: &str) -> PyString { |
| 248 | if cfg!(feature = "py2-no-auto-unicode-promotion") || s.is_ascii() { |
| 249 | PyBytes::new(py, s.as_bytes()).into_basestring() |
| 250 | } else { |
| 251 | PyUnicode::new(py, s).into_basestring() |
| 252 | } |
| 253 | } |
| 254 | #[cfg(feature = "python3-sys")] |
| 255 | fn new_impl(py: Python, s: &str) -> PyString { |
| 256 | let ptr = s.as_ptr() as *const c_char; |
nothing calls this directly
no test coverage detected