From 05f85f625eadb2688c69af89d533eeb69ba76da0 Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Fri, 13 Dec 2019 05:18:14 +0100 Subject: Make two_level trait impl more readable Also fix a little non-returning result issue --- src/simulation/two_level.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/simulation') diff --git a/src/simulation/two_level.rs b/src/simulation/two_level.rs index 99336a5..2d9d459 100644 --- a/src/simulation/two_level.rs +++ b/src/simulation/two_level.rs @@ -16,10 +16,8 @@ impl TwoLevel { impl State for TwoLevel { fn fibrate(&self) -> Vec { - self.state - .iter() - .flat_map(|c| [c.re, c.im]) - .map(|v| *v) + self.state.iter() + .flat_map(|c| std::iter::once(c.re).chain(std::iter::once(c.im))) .collect() } -- cgit v1.2.3-70-g09d2