Skip to content

Commit

Permalink
Rename some result variables as res, for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Nov 5, 2022
1 parent a838952 commit 43d21b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions compiler/rustc_lexer/src/unescape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ where
match mode {
Mode::Char | Mode::Byte => {
let mut chars = src.chars();
let result = unescape_char_or_byte(&mut chars, mode == Mode::Byte);
callback(0..(src.len() - chars.as_str().len()), result);
let res = unescape_char_or_byte(&mut chars, mode == Mode::Byte);
callback(0..(src.len() - chars.as_str().len()), res);
}
Mode::Str | Mode::ByteStr => unescape_str_or_byte_str(src, mode == Mode::ByteStr, callback),
Mode::RawStr | Mode::RawByteStr => {
Expand Down Expand Up @@ -263,7 +263,7 @@ where
// them in the range computation.
while let Some(c) = chars.next() {
let start = src.len() - chars.as_str().len() - c.len_utf8();
let result = match c {
let res = match c {
'\\' => {
match chars.clone().next() {
Some('\n') => {
Expand All @@ -284,7 +284,7 @@ where
_ => ascii_check(c, is_byte),
};
let end = src.len() - chars.as_str().len();
callback(start..end, result);
callback(start..end, res);
}

fn skip_ascii_whitespace<F>(chars: &mut Chars<'_>, start: usize, callback: &mut F)
Expand Down Expand Up @@ -329,12 +329,12 @@ where
// doesn't have to worry about skipping any chars.
while let Some(c) = chars.next() {
let start = src.len() - chars.as_str().len() - c.len_utf8();
let result = match c {
let res = match c {
'\r' => Err(EscapeError::BareCarriageReturnInRawString),
_ => ascii_check(c, is_byte),
};
let end = src.len() - chars.as_str().len();
callback(start..end, result);
callback(start..end, res);
}
}

Expand Down

0 comments on commit 43d21b5

Please sign in to comment.