range(a, b).foo() -> (a..b).foo()
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
This commit is contained in:
parent
bedd8108dc
commit
c300d681bd
55 changed files with 122 additions and 122 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue