Skip to content

Commit 07aacf5

Browse files
committed
Renamed variable str -> tail for clarity
1 parent efe069c commit 07aacf5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_lexer/src/unescape.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,17 @@ where
319319
where
320320
F: FnMut(Range<usize>, Result<char, EscapeError>),
321321
{
322-
let str = chars.as_str();
323-
let first_non_space = str
322+
let tail = chars.as_str();
323+
let first_non_space = tail
324324
.bytes()
325325
.position(|b| b != b' ' && b != b'\t' && b != b'\n' && b != b'\r')
326-
.unwrap_or(str.len());
327-
if str[1..first_non_space].contains('\n') {
326+
.unwrap_or(tail.len());
327+
if tail[1..first_non_space].contains('\n') {
328328
// The +1 accounts for the escaping slash.
329329
let end = start + first_non_space + 1;
330330
callback(start..end, Err(EscapeError::MultipleSkippedLinesWarning));
331331
}
332-
let tail = &str[first_non_space..];
332+
let tail = &tail[first_non_space..];
333333
if let Some(c) = tail.chars().nth(0) {
334334
// For error reporting, we would like the span to contain the character that was not
335335
// skipped. The +1 is necessary to account for the leading \ that started the escape.

0 commit comments

Comments
 (0)