about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPiotr Czarnecki <pioczarn@gmail.com>2015-12-03 08:06:16 +0100
committerPiotr Czarnecki <pioczarn@gmail.com>2016-01-05 11:02:43 +0100
commit100a4698defac5d060ecb89c30d9c5f0dc770c15 (patch)
tree00cbe13828164a22d698fb3b29a404b649711b38
parent72a5bb73c1056dcb34fad4af138258603bb36d18 (diff)
downloadrust-100a4698defac5d060ecb89c30d9c5f0dc770c15.tar.gz
rust-100a4698defac5d060ecb89c30d9c5f0dc770c15.zip
Ran rustfmt
-rw-r--r--src/libarena/lib.rs54
1 files changed, 19 insertions, 35 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs
index fe88d51470d..8aafc115a29 100644
--- a/src/libarena/lib.rs
+++ b/src/libarena/lib.rs
@@ -630,11 +630,7 @@ mod tests {
     #[bench]
     pub fn bench_copy_nonarena(b: &mut Bencher) {
         b.iter(|| {
-            let _: Box<_> = Box::new(Point {
-                x: 1,
-                y: 2,
-                z: 3
-            });
+            let _: Box<_> = Box::new(Point { x: 1, y: 2, z: 3 });
         })
     }
 
@@ -676,11 +672,7 @@ mod tests {
             for _ in 0..100 {
                 arena.alloc(|| ());
             }
-            arena.alloc(|| Point {
-                x: 1,
-                y: 2,
-                z: 3,
-            });
+            arena.alloc(|| Point { x: 1, y: 2, z: 3 });
         }
     }
 
@@ -690,11 +682,7 @@ mod tests {
         for _ in 0..10 {
             arena.clear();
             for _ in 0..10000 {
-                arena.alloc(Point {
-                    x: 1,
-                    y: 2,
-                    z: 3,
-                });
+                arena.alloc(Point { x: 1, y: 2, z: 3 });
             }
         }
     }
@@ -705,14 +693,12 @@ mod tests {
         for _ in 0..10 {
             arena.clear();
             for _ in 0..10000 {
-                arena.alloc(|| Point {
-                    x: 1,
-                    y: 2,
-                    z: 3,
-                });
-                arena.alloc(|| Noncopy {
-                    string: "hello world".to_string(),
-                    array: vec![],
+                arena.alloc(|| Point { x: 1, y: 2, z: 3 });
+                arena.alloc(|| {
+                    Noncopy {
+                        string: "hello world".to_string(),
+                        array: vec![],
+                    }
                 });
             }
         }
@@ -722,11 +708,7 @@ mod tests {
     pub fn test_arena_alloc_bytes() {
         let arena = Arena::new();
         for i in 0..10000 {
-            arena.alloc(|| Point {
-                x: 1,
-                y: 2,
-                z: 3,
-            });
+            arena.alloc(|| Point { x: 1, y: 2, z: 3 });
             for byte in arena.alloc_bytes(i % 42).iter_mut() {
                 *byte = i as u8;
             }
@@ -754,10 +736,10 @@ mod tests {
         for i in 0..10 {
             // Arena allocate something with drop glue to make sure it
             // doesn't leak.
-            arena.alloc(|| { Rc::new(i) });
+            arena.alloc(|| Rc::new(i));
             // Allocate something with funny size and alignment, to keep
             // things interesting.
-            arena.alloc(|| { [0u8, 1, 2] });
+            arena.alloc(|| [0u8, 1, 2]);
         }
         // Now, panic while allocating
         arena.alloc::<Rc<i32>, _>(|| {
@@ -771,7 +753,7 @@ mod tests {
         b.iter(|| {
             arena.alloc(Noncopy {
                 string: "hello world".to_string(),
-                array: vec!( 1, 2, 3, 4, 5 ),
+                array: vec![1, 2, 3, 4, 5],
             })
         })
     }
@@ -781,7 +763,7 @@ mod tests {
         b.iter(|| {
             let _: Box<_> = Box::new(Noncopy {
                 string: "hello world".to_string(),
-                array: vec!( 1, 2, 3, 4, 5 ),
+                array: vec![1, 2, 3, 4, 5],
             });
         })
     }
@@ -790,9 +772,11 @@ mod tests {
     pub fn bench_noncopy_old_arena(b: &mut Bencher) {
         let arena = Arena::new();
         b.iter(|| {
-            arena.alloc(|| Noncopy {
-                string: "hello world".to_string(),
-                array: vec!( 1, 2, 3, 4, 5 ),
+            arena.alloc(|| {
+                Noncopy {
+                    string: "hello world".to_string(),
+                    array: vec![1, 2, 3, 4, 5],
+                }
             })
         })
     }