diff options
author | Dennis Kobert <dennis@kobert.dev> | 2019-12-13 14:42:28 +0100 |
---|---|---|
committer | Dennis Kobert <dennis@kobert.dev> | 2019-12-13 14:42:28 +0100 |
commit | 5c311266e3bf28790fe1c41306913c272260a8f4 (patch) | |
tree | a47d100994e14a3ee07dfb68647ee3551d158961 | |
parent | 53f66593bd91cd54a3cc59124ef8db3f27c6b802 (diff) | |
parent | 05f85f625eadb2688c69af89d533eeb69ba76da0 (diff) |
-rw-r--r-- | src/plot/gnuplot.rs | 1 | ||||
-rw-r--r-- | src/simulation/two_level.rs | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/plot/gnuplot.rs b/src/plot/gnuplot.rs index 8bb5ac6..fec64b7 100644 --- a/src/plot/gnuplot.rs +++ b/src/plot/gnuplot.rs @@ -29,6 +29,7 @@ fn write_data_file(path: &str, data: &[[f64; 6]]) -> Result<(), io::Error> { line[0], line[1], line[2], line[3], line[4], line[5] ))?; } + Ok(()) } impl Gnuplot { 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() } |