simd-lite / simd-json-derive

high performance Serialize and Deserialize derives
Apache License 2.0
30 stars 7 forks source link

Support for Result #35

Closed julianbraha closed 1 year ago

julianbraha commented 1 year ago

serde's Deserialize supports Result, but simd-json-derive does not. See the following error when attempting to use #[derive(simd_json_derive::Deserialize)] with a struct that has a Result field:

error[E0277]: the trait bound `Result<(), MyFirstStruct>: simd_json_derive::Deserialize<'_>` is not satisfied
   --> src/my_project/types/response_types.rs:586:10
    |
586 | #[derive(simd_json_derive::Deserialize, Clone, Debug)]
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `simd_json_derive::Deserialize<'_>` is not implemented for `Result<(), MyFirstStruct>`
    |
    = help: the following other types implement trait `simd_json_derive::Deserialize<'input>`:
              &'input str
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 60 others
    = note: this error originates in the derive macro `simd_json_derive::Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
Licenser commented 1 year ago

released as v0.7.1