Make utf8chars.chars iter return `impl Iterator + fmt::Debug`.

PiperOrigin-RevId: 596599987
pull/15334/head
Protobuf Team Bot 11 months ago committed by Copybara-Service
parent 4e90eadcb3
commit 434d109d9c
  1. 2
      rust/string.rs

@ -344,7 +344,7 @@ impl ProtoStr {
/// [`U+FFFD REPLACEMENT CHARACTER`]. /// [`U+FFFD REPLACEMENT CHARACTER`].
/// ///
/// [`U+FFFD REPLACEMENT CHARACTER`]: std::char::REPLACEMENT_CHARACTER /// [`U+FFFD REPLACEMENT CHARACTER`]: std::char::REPLACEMENT_CHARACTER
pub fn chars(&self) -> impl Iterator<Item = char> + '_ { pub fn chars(&self) -> impl Iterator<Item = char> + '_ + fmt::Debug {
Utf8Chunks::new(self.as_bytes()).flat_map(|chunk| { Utf8Chunks::new(self.as_bytes()).flat_map(|chunk| {
let mut yield_replacement_char = !chunk.invalid().is_empty(); let mut yield_replacement_char = !chunk.invalid().is_empty();
chunk.valid().chars().chain(iter::from_fn(move || { chunk.valid().chars().chain(iter::from_fn(move || {

Loading…
Cancel
Save