Fix ssz_static deserialization

This commit is contained in:
Paul Hauner 2019-05-14 15:16:02 +10:00
parent 523caf52d6
commit 6096abf071
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -28,9 +28,11 @@ impl TestDecode for SszStatic {
impl SszStatic {
fn value<T: serde::de::DeserializeOwned>(&self) -> Result<T, Error> {
serde_yaml::from_str(&self.raw_yaml.as_str()).map_err(|e| {
let wrapper: Value<T> = serde_yaml::from_str(&self.raw_yaml.as_str()).map_err(|e| {
Error::FailedToParseTest(format!("Unable to parse {} YAML: {:?}", self.type_name, e))
})
})?;
Ok(wrapper.value)
}
}