diff options
| author | bors <bors@rust-lang.org> | 2018-06-26 23:15:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-26 23:15:30 +0000 |
| commit | 0cf0691ea1879a84d09d53a19e0f0b06827cf95a (patch) | |
| tree | 8a72b059c5adc812cf4a73c7603c9b3ad6c49d2d /src/libsyntax_ext | |
| parent | 84804c3874a15f55a905c0b53d820372003b0c24 (diff) | |
| parent | 64365e46f2675403babb2669d60d418fae3e0a7c (diff) | |
| download | rust-0cf0691ea1879a84d09d53a19e0f0b06827cf95a.tar.gz rust-0cf0691ea1879a84d09d53a19e0f0b06827cf95a.zip | |
Auto merge of #51149 - zackmdavis:․․․_to_․․=, r=nikomatsakis
lint to favor `..=` over `...` range patterns; migrate to `..=` throughout codebase We probably need an RFC to actually deprecate the `...` syntax, but here's a candidate implementation for the lint considered in #51043. (My local build is super flaky, but hopefully I got all of the test revisions.)
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/format_foreign.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax_ext/format_foreign.rs b/src/libsyntax_ext/format_foreign.rs index 0dd8f0c55d8..2393af76c34 100644 --- a/src/libsyntax_ext/format_foreign.rs +++ b/src/libsyntax_ext/format_foreign.rs @@ -374,7 +374,7 @@ pub mod printf { if let Start = state { match c { - '1'...'9' => { + '1'..='9' => { let end = at_next_cp_while(next, is_digit); match end.next_cp() { // Yes, this *is* the parameter. @@ -416,7 +416,7 @@ pub mod printf { state = WidthArg; move_to!(next); }, - '1' ... '9' => { + '1' ..= '9' => { let end = at_next_cp_while(next, is_digit); state = Prec; width = Some(Num::from_str(at.slice_between(end).unwrap(), None)); @@ -477,7 +477,7 @@ pub mod printf { } } }, - '0' ... '9' => { + '0' ..= '9' => { let end = at_next_cp_while(next, is_digit); state = Length; precision = Some(Num::from_str(at.slice_between(end).unwrap(), None)); @@ -570,7 +570,7 @@ pub mod printf { fn is_digit(c: char) -> bool { match c { - '0' ... '9' => true, + '0' ..= '9' => true, _ => false } } @@ -799,7 +799,7 @@ pub mod shell { let start = s.find('$')?; match s[start+1..].chars().next()? { '$' => return Some((Substitution::Escape, &s[start+2..])), - c @ '0' ... '9' => { + c @ '0' ..= '9' => { let n = (c as u8) - b'0'; return Some((Substitution::Ordinal(n), &s[start+2..])); }, @@ -836,14 +836,14 @@ pub mod shell { fn is_ident_head(c: char) -> bool { match c { - 'a' ... 'z' | 'A' ... 'Z' | '_' => true, + 'a' ..= 'z' | 'A' ..= 'Z' | '_' => true, _ => false } } fn is_ident_tail(c: char) -> bool { match c { - '0' ... '9' => true, + '0' ..= '9' => true, c => is_ident_head(c) } } |
