From 9d12dd63d22984c22318bbd2527a0df19e1c58de Mon Sep 17 00:00:00 2001 From: jofas Date: Thu, 4 Aug 2022 10:48:16 +0000 Subject: [PATCH] applying code formatting, lint fixes and toc creation --- benches/benches.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/benches/benches.rs b/benches/benches.rs index 49c1af8..3c44467 100644 --- a/benches/benches.rs +++ b/benches/benches.rs @@ -1,12 +1,14 @@ use map_macro::map; -use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use criterion::{ + black_box, criterion_group, criterion_main, Criterion, +}; use std::time::Duration; fn reapeatedly_allocate_map() { for _ in 0..500_000 { - map!{ + map! { 0 => "a", 1 => "b", 2 => "c", @@ -38,10 +40,12 @@ fn reapeatedly_allocate_map() { } fn bench_map_allocation(c: &mut Criterion) { - c.bench_function( - "map allocation", - |b| b.iter(|| black_box(reapeatedly_allocate_map())), - ); + c.bench_function("map allocation", |b| { + b.iter(|| { + reapeatedly_allocate_map(); + black_box(()) + }) + }); } criterion_group!(