(&self, f: impl Fn(CodePoint) -> bool)
| 1074 | } |
| 1075 | |
| 1076 | pub fn trim_start_matches(&self, f: impl Fn(CodePoint) -> bool) -> &Self { |
| 1077 | let mut iter = self.code_points(); |
| 1078 | loop { |
| 1079 | let old = iter.clone(); |
| 1080 | match iter.next().map(&f) { |
| 1081 | Some(true) => continue, |
| 1082 | Some(false) => { |
| 1083 | iter = old; |
| 1084 | break; |
| 1085 | } |
| 1086 | None => return iter.as_wtf8(), |
| 1087 | } |
| 1088 | } |
| 1089 | iter.as_wtf8() |
| 1090 | } |
| 1091 | |
| 1092 | pub fn trim_end_matches(&self, f: impl Fn(CodePoint) -> bool) -> &Self { |
| 1093 | let mut iter = self.code_points(); |
no test coverage detected