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
I noticed that the serde derive macro was incorrectly adding impl Serialize bounds to the structures that derive Serialize:
use serde::Serialize;#[derive(Debug,Serialize,Clone)]#[serde(rename_all = "camelCase")]pubstructFirst<Http>{second:Second<Http>,}#[derive(Debug,Serialize,Clone)]#[serde(rename_all = "camelCase")]pubstructSecond<Http>{nb:usize,#[serde(skip_serializing)]http_client:Http,}pubstructTruc;fnmain(){// This works, serde understands that `Http` doesn't need to implement `Serialize`let a = serde_json::to_string_pretty(&Second{nb:1,http_client:Truc,}).unwrap();// This doesn't; serde derive added a bound requiring that `Http` implements `Serialize`let a = serde_json::to_string_pretty(&First{second:Second{nb:1,http_client:Truc,},}).unwrap();}
The text was updated successfully, but these errors were encountered:
Hello,
I noticed that the serde derive macro was incorrectly adding
impl Serialize
bounds to the structures that deriveSerialize
:The text was updated successfully, but these errors were encountered: