| 228 | |
| 229 | #[inline] |
| 230 | fn py_strip<'a, S, FC, FD>( |
| 231 | &'a self, |
| 232 | chars: OptionalOption<S>, |
| 233 | func_chars: FC, |
| 234 | func_default: FD, |
| 235 | ) -> &'a Self |
| 236 | where |
| 237 | S: AnyStrWrapper<Self>, |
| 238 | FC: Fn(&'a Self, &Self) -> &'a Self, |
| 239 | FD: Fn(&'a Self) -> &'a Self, |
| 240 | { |
| 241 | let chars = chars.flatten(); |
| 242 | match chars { |
| 243 | Some(chars) => { |
| 244 | if let Some(chars) = chars.as_ref() { |
| 245 | func_chars(self, chars) |
| 246 | } else { |
| 247 | self |
| 248 | } |
| 249 | } |
| 250 | None => func_default(self), |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | #[inline] |
| 255 | fn py_find<F>(&self, needle: &Self, range: Range<usize>, find: F) -> Option<usize> |