Skip to content

Instantly share code, notes, and snippets.

@DarkFenX
Created May 19, 2020 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarkFenX/640a3d472cfac6fcd01b39b74459cee6 to your computer and use it in GitHub Desktop.
Save DarkFenX/640a3d472cfac6fcd01b39b74459cee6 to your computer and use it in GitHub Desktop.
error[E0277]: the trait bound `for<'de> T: dh_impls::phobos::data::_IMPL_DESERIALIZE_FOR_EveType::_serde::Deserialize<'de>` is not satisfied
--> core/src/dh_impls/phobos/handler.rs:56:44
|
56 | match serde_json::from_value::<T>(value) {
| ^ the trait `for<'de> dh_impls::phobos::data::_IMPL_DESERIALIZE_FOR_EveType::_serde::Deserialize<'de>` is not implemented for `T`
|
::: /home/dfx/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.53/src/value/mod.rs:1004:8
|
1004 | T: DeserializeOwned,
| ---------------- required by this bound in `serde_json::value::from_value`
|
help: consider further restricting this bound with `+ for<'de> dh_impls::phobos::data::_IMPL_DESERIALIZE_FOR_EveType::_serde::Deserialize<'de>`
--> core/src/dh_impls/phobos/handler.rs:51:9
|
51 | T: Into<U>,
| ^^^^^^^^^^
= note: required because of the requirements on the impl of `dh_impls::phobos::data::_IMPL_DESERIALIZE_FOR_EveType::_serde::de::DeserializeOwned` for `T`
fn convert_fsdlite<T, U>(decomposed: Vec<serde_json::Value>) -> dh::Result<U>
where
T: Into<U>,
{
let mut data = Vec::new();
let mut errors: u32 = 0;
for value in decomposed {
match serde_json::from_value::<T>(value) {
Ok(v) => data.push(v.into()),
Err(_) => errors += 1,
}
}
Ok(dh::Container::new(data, errors))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment