Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use enumerate in place of 'for ti in range(i, tokens.len()) ...' #9030

Closed
wants to merge 1 commit into from

Conversation

tikue
Copy link
Contributor

@tikue tikue commented Sep 7, 2013

No description provided.

@@ -304,8 +304,8 @@ impl Pattern {
&& is_sep(prev_char.unwrap_or_default('/')))
};

for ti in range(i, self.tokens.len()) {
match self.tokens[ti] {
for (ti, token) in self.tokens.slice_from(i).iter().enumerate() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean that ti_new == ti_old - i (i.e. it's a different number)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Updated the place where ti is used.

bors added a commit that referenced this pull request Sep 7, 2013
@bors bors closed this Sep 7, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2022
…ip1995

Remove `cargo_dev` dependency

changelog: none

Sorry about that 😅.

r? `@flip1995`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants