pub fn parse_f32(value: &Value, key: &str) -> Result<f32, SimulationError>Expand description
Helper function to parse f32 from YAML
§Arguments
value- YAML valuekey- key to parse
§Returns
f32- parsed value
§Errors
SimulationError- if the value is not a valid f32
§Example
use peng_quad::{parse_f32, SimulationError};
let value = serde_yaml::from_str("key: 1.0").unwrap();
let result = parse_f32(&value, "key").unwrap();
assert_eq!(result, 1.0);