mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Fix SemiparsedVec::from
This commit is contained in:
parent
32b446d26c
commit
cd9a98163c
1 changed files with 5 additions and 1 deletions
|
@ -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(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue