(&self)
| 1039 | |
| 1040 | #[pymethod] |
| 1041 | fn swapcase(&self) -> Wtf8Buf { |
| 1042 | let mut swapped_str = Wtf8Buf::with_capacity(self.data.len()); |
| 1043 | for c_orig in self.as_wtf8().code_points() { |
| 1044 | let c = c_orig.to_char_lossy(); |
| 1045 | // to_uppercase returns an iterator, to_ascii_uppercase returns the char |
| 1046 | if c.is_lowercase() { |
| 1047 | swapped_str.push_char(c.to_ascii_uppercase()); |
| 1048 | } else if c.is_uppercase() { |
| 1049 | swapped_str.push_char(c.to_ascii_lowercase()); |
| 1050 | } else { |
| 1051 | swapped_str.push(c_orig); |
| 1052 | } |
| 1053 | } |
| 1054 | swapped_str |
| 1055 | } |
| 1056 | |
| 1057 | #[pymethod] |
| 1058 | fn isalpha(&self) -> bool { |
nothing calls this directly
no test coverage detected