for x in range(a, b) -> for x in a..b

sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
This commit is contained in:
Jorge Aparicio
2015-01-26 15:46:12 -05:00
parent c300d681bd
commit 7d661af9c8
155 changed files with 490 additions and 490 deletions

View File

@@ -732,7 +732,7 @@ impl<'a> StringReader<'a> {
let start_bpos = self.last_pos;
let mut accum_int = 0;
for _ in range(0, n_digits) {
for _ in 0..n_digits {
if self.is_eof() {
let last_bpos = self.last_pos;
self.fatal_span_(start_bpos, last_bpos, "unterminated numeric character escape");
@@ -1217,7 +1217,7 @@ impl<'a> StringReader<'a> {
}
//if self.curr_is('"') {
//content_end_bpos = self.last_pos;
//for _ in range(0, hash_count) {
//for _ in 0..hash_count {
//self.bump();
//if !self.curr_is('#') {
//continue 'outer;
@@ -1225,7 +1225,7 @@ impl<'a> StringReader<'a> {
match c {
'"' => {
content_end_bpos = self.last_pos;
for _ in range(0, hash_count) {
for _ in 0..hash_count {
self.bump();
if !self.curr_is('#') {
continue 'outer;
@@ -1402,7 +1402,7 @@ impl<'a> StringReader<'a> {
},
Some('"') => {
content_end_bpos = self.last_pos;
for _ in range(0, hash_count) {
for _ in 0..hash_count {
self.bump();
if !self.curr_is('#') {
continue 'outer;

View File

@@ -472,7 +472,7 @@ pub fn str_lit(lit: &str) -> String {
} else {
// otherwise, a normal escape
let (c, n) = char_lit(&lit[i..]);
for _ in range(0, n - 1) { // we don't need to move past the first \
for _ in 0..n - 1 { // we don't need to move past the first \
chars.next();
}
res.push(c);
@@ -635,7 +635,7 @@ pub fn binary_lit(lit: &str) -> Rc<Vec<u8>> {
// otherwise, a normal escape
let (c, n) = byte_lit(&lit[i..]);
// we don't need to move past the first \
for _ in range(0, n - 1) {
for _ in 0..n - 1 {
chars.next();
}
res.push(c);