diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2021-01-16 12:46:57 +0300 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2021-01-17 17:40:58 +0300 |
commit | 9111e9dd01ac08b5a7e40ad0f348946816d6d140 (patch) | |
tree | 10ba859e7aa4ad2162f58d401974a1c8aa6f6c72 /compiler/rustc_parse_format | |
parent | d51cf9601c714a8383aecade7c98559dd4831625 (diff) | |
download | rust-9111e9dd01ac08b5a7e40ad0f348946816d6d140.tar.gz |
rustc_parse_format: Fix character indices in find_skips
Fixes #81006
Diffstat (limited to 'compiler/rustc_parse_format')
-rw-r--r-- | compiler/rustc_parse_format/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index f7b16bd991b..f150f7a41ae 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -736,7 +736,7 @@ fn find_skips_from_snippet( fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> { let mut eat_ws = false; - let mut s = snippet.chars().enumerate().peekable(); + let mut s = snippet.char_indices().peekable(); let mut skips = vec![]; while let Some((pos, c)) = s.next() { match (c, s.peek()) { |