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 } }