Uh oh!
There was an error while loading. Please reload this page.
Two lexer tweaks - #36921
Merged
Merged
Conversation
First, assert! is redundant w.r.t. the unwrap() immediately afterwards. Second, `byte_offset_diff` is effectively computed as `current_byte_offset + ch.len_utf8() - current_byte_offset` (with `next` as an intermediate) which is silly and can be simplified.
rust-highfive
commented
Oct 3, 2016
Contributor
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
The two branches of this `if` compute the same value. This commit gets rid of the first branch, which makes this calculation identical to the one in scan_block_comment().
nnethercoteforce-pushed
the
two-lexer-tweaks
branch
from
October 3, 2016 08:03
efbed79 to
9e3dcb4Comparenagisa
commented
Oct 3, 2016
Member
This seems good to me. |
nrc
commented
Oct 3, 2016
Member
#36470 has been r+'ed now, so I think this PR can be closed (it will have to go through the slightly longer syntax-breaking-change landing process though). We could land this PR directly since it does not change any API, but that would mean rebasing #36470. @nnethercote do you have a preference? |
nnethercote
commented
Oct 3, 2016
ContributorAuthor
nrc
commented
Oct 3, 2016
Member
@bors: r+ |
bors
commented
Oct 3, 2016
Collaborator
📌 Commit 9e3dcb4 has been approved by |
Manishearth added a commit
to Manishearth/rust
that referenced
this pull request
Oct 4, 2016
Two lexer tweaks 19 days later, I haven't received a review of my commits in rust-lang#36470. In an attempt to make some progress, I'm going to split up the changes. Here are the ones that don't relate to renaming things.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
19 days later, I haven't received a review of my commits in #36470. In an attempt to make some progress, I'm going to split up the changes. Here are the ones that don't relate to renaming things.