(&self)
| 921 | } |
| 922 | |
| 923 | pub fn title(&self) -> Vec<u8> { |
| 924 | let mut res = vec![]; |
| 925 | let mut spaced = true; |
| 926 | |
| 927 | for i in &self.elements { |
| 928 | match i { |
| 929 | b'A'..=b'Z' | b'a'..=b'z' => { |
| 930 | if spaced { |
| 931 | res.push(i.to_ascii_uppercase()); |
| 932 | spaced = false |
| 933 | } else { |
| 934 | res.push(i.to_ascii_lowercase()); |
| 935 | } |
| 936 | } |
| 937 | _ => { |
| 938 | res.push(*i); |
| 939 | spaced = true |
| 940 | } |
| 941 | } |
| 942 | } |
| 943 | |
| 944 | res |
| 945 | } |
| 946 | |
| 947 | pub fn cformat(&self, values: PyObjectRef, vm: &VirtualMachine) -> PyResult<Vec<u8>> { |
| 948 | cformat_bytes(vm, self.elements.as_slice(), values) |
no test coverage detected