Fix SemiparsedVec::from

This commit is contained in:
Temirkhan Myrzamadi 2021-03-13 21:11:54 +06:00
parent 32b446d26c
commit cd9a98163c

View file

@ -12,7 +12,11 @@ pub struct SemiparsedVec<T>(pub Vec<Result<T, (serde_json::Value, serde_json::Er
impl<T: DeserializeOwned> From<Vec<serde_json::Value>> for SemiparsedVec<T> {
fn from(vec: Vec<Value>) -> Self {
Self(vec.into_iter().map(|val| (val, e)).collect())
Self(
vec.into_iter()
.map(|val| from_value(val.clone()).map_err(|e| (val, e)))
.collect(),
)
}
}