diff options
| author | Tim Kuehn <tkuehn@cmu.edu> | 2013-09-06 21:36:48 -0400 |
|---|---|---|
| committer | Tim Kuehn <tkuehn@cmu.edu> | 2013-09-06 21:54:03 -0400 |
| commit | 39ce095ebdfcfb35f93b386bcf5a6f0586f78611 (patch) | |
| tree | e93f6e8a405c2a7ea5adfe8501e94194736906da | |
| parent | f883159cdf3a84967513dfb27f004499ac456a1a (diff) | |
| download | rust-39ce095ebdfcfb35f93b386bcf5a6f0586f78611.tar.gz rust-39ce095ebdfcfb35f93b386bcf5a6f0586f78611.zip | |
use enumerate in place of 'for ti in range(i, tokens.len()) ... match tokens[ti] ...'
| -rw-r--r-- | src/libextra/glob.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libextra/glob.rs b/src/libextra/glob.rs index 6f58102e00a..d82c1fd35c2 100644 --- a/src/libextra/glob.rs +++ b/src/libextra/glob.rs @@ -304,11 +304,11 @@ 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() { + match *token { AnySequence => { loop { - match self.matches_from(prev_char, file, ti + 1, options) { + match self.matches_from(prev_char, file, i + ti + 1, options) { SubPatternDoesntMatch => (), // keep trying m => return m, } @@ -331,7 +331,7 @@ impl Pattern { } let (c, next) = file.slice_shift_char(); - let matches = match self.tokens[ti] { + let matches = match *token { AnyChar => { !require_literal(c) } |
