(&self)
| 1251 | |
| 1252 | #[pymethod] |
| 1253 | fn istitle(&self) -> bool { |
| 1254 | if self.data.is_empty() { |
| 1255 | return false; |
| 1256 | } |
| 1257 | |
| 1258 | let mut cased = false; |
| 1259 | let mut previous_is_cased = false; |
| 1260 | for c in self.as_wtf8().code_points().map(CodePoint::to_char_lossy) { |
| 1261 | if c.is_uppercase() || c.is_titlecase() { |
| 1262 | if previous_is_cased { |
| 1263 | return false; |
| 1264 | } |
| 1265 | previous_is_cased = true; |
| 1266 | cased = true; |
| 1267 | } else if c.is_lowercase() { |
| 1268 | if !previous_is_cased { |
| 1269 | return false; |
| 1270 | } |
| 1271 | previous_is_cased = true; |
| 1272 | cased = true; |
| 1273 | } else { |
| 1274 | previous_is_cased = false; |
| 1275 | } |
| 1276 | } |
| 1277 | cased |
| 1278 | } |
| 1279 | |
| 1280 | #[pymethod] |
| 1281 | fn count(&self, args: FindArgs) -> usize { |
nothing calls this directly
no test coverage detected