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
|
|
@ -1598,7 +1598,7 @@ fn encode_index<T, F>(rbml_w: &mut Encoder, index: Vec<entry<T>>, mut write_fn:
|
|||
F: FnMut(&mut SeekableMemWriter, &T),
|
||||
T: Hash<SipHasher>,
|
||||
{
|
||||
let mut buckets: Vec<Vec<entry<T>>> = range(0, 256u16).map(|_| Vec::new()).collect();
|
||||
let mut buckets: Vec<Vec<entry<T>>> = (0..256u16).map(|_| Vec::new()).collect();
|
||||
for elt in index.into_iter() {
|
||||
let mut s = SipHasher::new();
|
||||
elt.val.hash(&mut s);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ impl<'a> fmt::Debug for Matrix<'a> {
|
|||
|
||||
let column_count = m.iter().map(|row| row.len()).max().unwrap_or(0u);
|
||||
assert!(m.iter().all(|row| row.len() == column_count));
|
||||
let column_widths: Vec<uint> = range(0, column_count).map(|col| {
|
||||
let column_widths: Vec<uint> = (0..column_count).map(|col| {
|
||||
pretty_printed_matrix.iter().map(|row| row[col].len()).max().unwrap_or(0u)
|
||||
}).collect();
|
||||
|
||||
|
|
@ -609,7 +609,7 @@ fn is_useful(cx: &MatchCheckCtxt,
|
|||
let arity = constructor_arity(cx, &c, left_ty);
|
||||
let mut result = {
|
||||
let pat_slice = &pats[];
|
||||
let subpats: Vec<_> = range(0, arity).map(|i| {
|
||||
let subpats: Vec<_> = (0..arity).map(|i| {
|
||||
pat_slice.get(i).map_or(DUMMY_WILD_PAT, |p| &**p)
|
||||
}).collect();
|
||||
vec![construct_witness(cx, &c, subpats, left_ty)]
|
||||
|
|
|
|||
|
|
@ -1343,7 +1343,7 @@ impl<'a, 'tcx> Rebuilder<'a, 'tcx> {
|
|||
let mut new_lts = Vec::new();
|
||||
if data.lifetimes.len() == 0 {
|
||||
// traverse once to see if there's a need to insert lifetime
|
||||
let need_insert = range(0, expected).any(|i| {
|
||||
let need_insert = (0..expected).any(|i| {
|
||||
indexes.contains(&i)
|
||||
});
|
||||
if need_insert {
|
||||
|
|
|
|||
|
|
@ -828,7 +828,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
}
|
||||
|
||||
pub fn next_ty_vars(&self, n: uint) -> Vec<Ty<'tcx>> {
|
||||
range(0, n).map(|_i| self.next_ty_var()).collect()
|
||||
(0..n).map(|_i| self.next_ty_var()).collect()
|
||||
}
|
||||
|
||||
pub fn next_int_var_id(&self) -> IntVid {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue