diff --git a/benches/parabole.rs b/benches/parabole.rs index 958c9c4..93e2ac2 100644 --- a/benches/parabole.rs +++ b/benches/parabole.rs @@ -101,11 +101,13 @@ 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); }); @@ -120,7 +122,8 @@ 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 8016faf..cd5b76c 100644 --- a/examples/parabole.rs +++ b/examples/parabole.rs @@ -87,11 +87,13 @@ 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); }); @@ -106,7 +108,8 @@ 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 053aa85..0cea4bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,7 +88,8 @@ where .map(|individual| Wrapper { individual, fitness: None, - }).for_each(|wrapper| { + }) + .for_each(|wrapper| { population.push(wrapper); }); @@ -139,7 +140,8 @@ where .map(|individual| Wrapper { individual, fitness: None, - }).collect_into_vec(&mut population); + }) + .collect_into_vec(&mut population); ParSimulation { population } }