You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust newbie here. I was trying out sample code but Response::try_into throws compilers error on newer rust editions.
Reproduce
Go to examples/simple
Set the edition field of Cargo.toml to 2021
Run cargo check
Compiling dgraph-tonic v0.10.2 (/Users/kimirti/tmp/dgraph-tonic)
Checking simple v0.1.0 (/Users/kimirti/tmp/dgraph-tonic/examples/simple)
warning: use of deprecated associated function `chrono::TimeZone::ymd`: use `with_ymd_and_hms()` instead
--> src/main.rs:73:18
|
73 | dob: Utc.ymd(1980, 1, 1).and_hms(23, 0, 0),
| ^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated associated function `chrono::Date::<Tz>::and_hms`: Use and_hms_opt() instead
--> src/main.rs:73:34
|
73 | dob: Utc.ymd(1980, 1, 1).and_hms(23, 0, 0),
| ^^^^^^^
error[E0277]: the trait bound `All: From<Response>` is not satisfied
--> src/main.rs:136:25
|
136 | let ppl: All = resp.try_into().expect("JSON");
| ^^^^^^^^ the trait `From<Response>` is not implemented for `All`
|
= note: required for `Response` to implement `Into<All>`
= note: required for `All` to implement `TryFrom<Response>`
= note: required for `Response` to implement `TryInto<All>`
For more information about this error, try `rustc --explain E0277`.
warning: `simple` (bin "simple") generated 2 warnings
error: could not compile `simple` due to previous error; 2 warnings emitted
I couldn't really understand why this is happening. The type All implements serde::Deserialize
Rust newbie here. I was trying out sample code but Response::try_into throws compilers error on newer rust editions.
Reproduce
Cargo.toml
to2021
cargo check
I couldn't really understand why this is happening. The type
All
implementsserde::Deserialize
And
Response
implements the try_into function.The text was updated successfully, but these errors were encountered: