mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Avoid unnecessary comparisons with cur_end
This commit is contained in:
parent
a92a1cb512
commit
a1d137116b
@ -105,12 +105,12 @@ pub fn rewrite_string<'a>(
|
||||
while !(punctuation.contains(graphemes[cur_end - 1])
|
||||
|| graphemes[cur_end - 1].trim().is_empty())
|
||||
{
|
||||
if cur_end >= graphemes.len() {
|
||||
cur_end += 1;
|
||||
if cur_end == graphemes.len() {
|
||||
let line = &graphemes[cur_start..].join("");
|
||||
result.push_str(line);
|
||||
break 'outer;
|
||||
}
|
||||
cur_end += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user