Use serde for json configuration file

This commit is contained in:
2020-09-03 21:30:28 +02:00
parent f90618be42
commit d0e6727ac3
6 changed files with 304 additions and 8 deletions

View File

@@ -402,6 +402,7 @@ fn h2_diff() {
}
#[derive(Copy, Clone, Debug)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct Vortice {
pub x0: Float,
pub y0: Float,
@@ -409,7 +410,11 @@ pub struct Vortice {
pub eps: Float,
}
#[cfg(feature = "serde1")]
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct VortexParameters {
pub vortices: ArrayVec<[Vortice; 5]>,
pub mach: Float,