(&self, suffix: &Self, suffix_len: usize, is_suffix: FC)
| 355 | } |
| 356 | |
| 357 | fn py_removesuffix<FC>(&self, suffix: &Self, suffix_len: usize, is_suffix: FC) -> &Self |
| 358 | where |
| 359 | FC: Fn(&Self, &Self) -> bool, |
| 360 | { |
| 361 | if is_suffix(self, suffix) { |
| 362 | self.get_bytes(0..self.bytes_len() - suffix_len) |
| 363 | } else { |
| 364 | self |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | // TODO: remove this function from anystr. |
| 369 | // See https://github.com/RustPython/RustPython/pull/4709/files#r1141013993 |
no test coverage detected