(&self, s: impl Into<pystr::PyStr>)
| 527 | |
| 528 | #[inline] |
| 529 | pub fn new_str(&self, s: impl Into<pystr::PyStr>) -> PyRef<PyStr> { |
| 530 | let s = s.into(); |
| 531 | if let Some(ch) = Self::latin1_singleton_index(&s) { |
| 532 | return self.latin1_char(ch); |
| 533 | } |
| 534 | s.into_ref(self) |
| 535 | } |
| 536 | |
| 537 | #[inline] |
| 538 | pub fn new_utf8_str(&self, s: impl Into<PyUtf8Str>) -> PyRef<PyUtf8Str> { |