From db996837e7fbe2581c1603e59edd2e129afff3f4 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Fri, 14 Sep 2018 08:59:09 +0200 Subject: [PATCH] Fmt. --- benches/parabole.rs | 9 +++------ examples/parabole.rs | 9 +++------ src/lib.rs | 6 ++---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/benches/parabole.rs b/benches/parabole.rs index 93e2ac2..958c9c4 100644 --- a/benches/parabole.rs +++ b/benches/parabole.rs @@ -101,13 +101,11 @@ fn criterion_benchmark(c: &mut Criterion) { .filter(|&(n, _)| n % 2 == 1) .map(|(_, wrapper)| wrapper) .take(5), - ) - .map(|(a, b)| a.individual.mate(&b.individual)) + ).map(|(a, b)| a.individual.mate(&b.individual)) .map(|individual| Wrapper { individual, fitness: None, - }) - .for_each(|wrapper| { + }).for_each(|wrapper| { population.push(wrapper); }); @@ -122,8 +120,7 @@ fn criterion_benchmark(c: &mut Criterion) { individual, fitness: None, } - }) - .collect_into_vec(population); + }).collect_into_vec(population); // Add all parents again. population.extend(parents.iter().cloned()); diff --git a/examples/parabole.rs b/examples/parabole.rs index cd5b76c..8016faf 100644 --- a/examples/parabole.rs +++ b/examples/parabole.rs @@ -87,13 +87,11 @@ fn main() { .filter(|&(n, _)| n % 2 == 1) .map(|(_, wrapper)| wrapper) .take(5), - ) - .map(|(a, b)| a.individual.mate(&b.individual)) + ).map(|(a, b)| a.individual.mate(&b.individual)) .map(|individual| Wrapper { individual, fitness: None, - }) - .for_each(|wrapper| { + }).for_each(|wrapper| { population.push(wrapper); }); @@ -108,8 +106,7 @@ fn main() { individual, fitness: None, } - }) - .collect_into_vec(population); + }).collect_into_vec(population); // Add all parents again. population.extend(parents.iter().cloned()); diff --git a/src/lib.rs b/src/lib.rs index 0cea4bf..053aa85 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,8 +88,7 @@ where .map(|individual| Wrapper { individual, fitness: None, - }) - .for_each(|wrapper| { + }).for_each(|wrapper| { population.push(wrapper); }); @@ -140,8 +139,7 @@ where .map(|individual| Wrapper { individual, fitness: None, - }) - .collect_into_vec(&mut population); + }).collect_into_vec(&mut population); ParSimulation { population } }