range(a, b).foo() -> (a..b).foo()

sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
This commit is contained in:
Jorge Aparicio 2015-01-26 15:44:22 -05:00
parent bedd8108dc
commit c300d681bd
55 changed files with 122 additions and 122 deletions

View file

@ -242,7 +242,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
if i < 0
|| buf[i as uint] == b'-'
|| buf[i as uint] == b'+' {
for j in range(i as uint + 1, end).rev() {
for j in (i as uint + 1..end).rev() {
buf[j + 1] = buf[j];
}
buf[(i + 1) as uint] = value2ascii(1);

View file

@ -717,7 +717,7 @@ pub trait IteratorExt: Iterator + Sized {
Self: ExactSizeIterator + DoubleEndedIterator
{
let len = self.len();
for i in range(0, len).rev() {
for i in (0..len).rev() {
if predicate(self.next_back().expect("rposition: incorrect ExactSizeIterator")) {
return Some(i);
}

View file

@ -812,7 +812,7 @@ impl TwoWaySearcher {
// See if the left part of the needle matches
let start = if long_period { 0 } else { self.memory };
for i in range(start, self.crit_pos).rev() {
for i in (start..self.crit_pos).rev() {
if needle[i] != haystack[self.position + i] {
self.position += self.period;
if !long_period {