From 5b62c23d975145f9004bc7ae35af2d51ef30ce0d Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Thu, 8 Feb 2024 09:59:44 -0500 Subject: [PATCH] Formatting Signed-off-by: Moritz Hoffmann --- benches/bench.rs | 12 +++++++++--- src/impls/slice_copy.rs | 12 ++++++------ src/impls/string.rs | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/benches/bench.rs b/benches/bench.rs index 35a15a2..4a0e143 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -4,9 +4,12 @@ extern crate test; -use flatcontainer::{Containerized, CopyOnto, CopyRegion, FlatStack, MirrorRegion, Region, ReserveItems, SliceRegion, StringRegion}; -use test::Bencher; use flatcontainer::impls::tuple::TupleABCRegion; +use flatcontainer::{ + Containerized, CopyOnto, CopyRegion, FlatStack, MirrorRegion, Region, ReserveItems, + SliceRegion, StringRegion, +}; +use test::Bencher; #[bench] fn empty_copy(bencher: &mut Bencher) { @@ -92,7 +95,10 @@ fn vec_u_s_copy_region(bencher: &mut Bencher) { } #[bench] fn vec_u_vn_s_copy_region(bencher: &mut Bencher) { - _bench_copy_region::, CopyRegion<_>, StringRegion>>>, _>( + _bench_copy_region::< + SliceRegion, CopyRegion<_>, StringRegion>>>, + _, + >( bencher, vec![vec![(0u64, vec![(); 1 << 40], "grawwwwrr!".to_string()); 32]; 32], ); diff --git a/src/impls/slice_copy.rs b/src/impls/slice_copy.rs index 01d9b93..db66276 100644 --- a/src/impls/slice_copy.rs +++ b/src/impls/slice_copy.rs @@ -72,16 +72,16 @@ where impl ReserveItems> for &[T] { fn reserve_items(target: &mut CopyRegion, items: I) - where - I: Iterator + Clone, + where + I: Iterator + Clone, { target.slices.reserve(items.clone().map(|i| i.len()).sum()); } } impl CopyOnto> for &Vec - where - T: Copy, +where + T: Copy, { fn copy_onto(self, target: &mut CopyRegion) -> as Region>::Index { let start = target.slices.len(); @@ -92,8 +92,8 @@ impl CopyOnto> for &Vec impl ReserveItems> for &Vec { fn reserve_items(target: &mut CopyRegion, items: I) - where - I: Iterator + Clone, + where + I: Iterator + Clone, { target.slices.reserve(items.clone().map(|i| i.len()).sum()); } diff --git a/src/impls/string.rs b/src/impls/string.rs index 3e720a9..8b61982 100644 --- a/src/impls/string.rs +++ b/src/impls/string.rs @@ -93,8 +93,8 @@ impl CopyOnto for &&str { impl ReserveItems for &str { fn reserve_items(target: &mut StringRegion, items: I) - where - I: Iterator + Clone, + where + I: Iterator + Clone, { ReserveItems::reserve_items(&mut target.inner, items.map(str::as_bytes)) }