diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2015-01-26 15:46:12 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2015-01-29 07:47:37 -0500 |
| commit | 7d661af9c86566088f7dbaeee25143ecde673b75 (patch) | |
| tree | 54aa9b410d06064bdc893f034e1b86921698aea9 /src/libarena | |
| parent | c300d681bd2e901ef39591bbfb1ea4568ac6be70 (diff) | |
`for x in range(a, b)` -> `for x in a..b`
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
Diffstat (limited to 'src/libarena')
| -rw-r--r-- | src/libarena/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 9396e2d6fb2..9744feb4ee7 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -311,7 +311,7 @@ impl Arena { #[test] fn test_arena_destructors() { let arena = Arena::new(); - for i in range(0u, 10) { + for i in 0u..10 { // Arena allocate something with drop glue to make sure it // doesn't leak. arena.alloc(|| Rc::new(i)); @@ -340,7 +340,7 @@ fn test_arena_alloc_nested() { fn test_arena_destructors_fail() { let arena = Arena::new(); // Put some stuff in the arena. - for i in range(0u, 10) { + for i in 0u..10 { // Arena allocate something with drop glue to make sure it // doesn't leak. arena.alloc(|| { Rc::new(i) }); @@ -410,7 +410,7 @@ impl<T> TypedArenaChunk<T> { // Destroy all the allocated objects. if intrinsics::needs_drop::<T>() { let mut start = self.start(); - for _ in range(0, len) { + for _ in 0..len { ptr::read(start as *const T); // run the destructor on the pointer start = start.offset(mem::size_of::<T>() as int) } @@ -530,7 +530,7 @@ mod tests { #[test] pub fn test_copy() { let arena = TypedArena::new(); - for _ in range(0u, 100000) { + for _ in 0u..100000 { arena.alloc(Point { x: 1, y: 2, @@ -585,7 +585,7 @@ mod tests { #[test] pub fn test_noncopy() { let arena = TypedArena::new(); - for _ in range(0u, 100000) { + for _ in 0u..100000 { arena.alloc(Noncopy { string: "hello world".to_string(), array: vec!( 1, 2, 3, 4, 5 ), |
