summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authornatrixaeria <upezu@student.kit.edu>2019-12-13 05:18:14 +0100
committernatrixaeria <upezu@student.kit.edu>2019-12-13 05:20:12 +0100
commit05f85f625eadb2688c69af89d533eeb69ba76da0 (patch)
treee8a044f7e3b9082def36c62308c170e17a26cfcf /src/simulation
parentfc7daf3cb0ab42733a52ce9993570909ed059574 (diff)
Make two_level trait impl more readable
Also fix a little non-returning result issue
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/two_level.rs6
1 files changed, 2 insertions, 4 deletions
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<f64> {
- 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()
}