]> git.lizzy.rs Git - rust.git/commitdiff
Improve comments.
authorNicholas Nethercote <n.nethercote@gmail.com>
Thu, 3 Nov 2022 05:26:27 +0000 (16:26 +1100)
committerNicholas Nethercote <n.nethercote@gmail.com>
Fri, 4 Nov 2022 03:24:41 +0000 (14:24 +1100)
Remove a low-value comment, remove a duplicate comment, and correct a
third comment.

compiler/rustc_lexer/src/unescape.rs

index 9c9cce7cbd48ec2ff1009e6757167c1a85b52287..db7bf02e71adc5d60fd34de3c11301f6efdd3554 100644 (file)
@@ -84,12 +84,9 @@ pub fn unescape_literal<F>(src: &str, mode: Mode, callback: &mut F)
         Mode::Char | Mode::Byte => {
             let mut chars = src.chars();
             let result = unescape_char_or_byte(&mut chars, mode == Mode::Byte);
-            // The Chars iterator moved forward.
             callback(0..(src.len() - chars.as_str().len()), result);
         }
         Mode::Str | Mode::ByteStr => unescape_str_or_byte_str(src, mode == Mode::ByteStr, callback),
-        // NOTE: Raw strings do not perform any explicit character escaping, here we
-        // only translate CRLF to LF and produce errors on bare CR.
         Mode::RawStr | Mode::RawByteStr => {
             unescape_raw_str_or_raw_byte_str(src, mode == Mode::RawByteStr, callback)
         }
@@ -333,7 +330,7 @@ fn skip_ascii_whitespace<F>(chars: &mut Chars<'_>, start: usize, callback: &mut
 /// Takes a contents of a string literal (without quotes) and produces a
 /// sequence of characters or errors.
 /// NOTE: Raw strings do not perform any explicit character escaping, here we
-/// only translate CRLF to LF and produce errors on bare CR.
+/// only produce errors on bare CR.
 fn unescape_raw_str_or_raw_byte_str<F>(src: &str, is_byte: bool, callback: &mut F)
 where
     F: FnMut(Range<usize>, Result<char, EscapeError>),