(&mut self)
| 487 | } |
| 488 | |
| 489 | pub fn pop(&mut self) -> Option<CodePoint> { |
| 490 | let ch = self.code_points().next_back()?; |
| 491 | let new_len = self.len() - ch.len_wtf8(); |
| 492 | self.bytes.truncate(new_len); |
| 493 | Some(ch) |
| 494 | } |
| 495 | |
| 496 | /// Shortens a string to the specified length. |
| 497 | /// |