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
Here is an example showing the actual and expected output:
use serde::{Deserialize,Serialize};#[derive(Deserialize,Serialize)]#[serde(tag = "key", content = "value")]enumMyEnum{A(#[serde(skip_serializing_if = "Option::is_none")]Option<u32>),}#[test]fnit_works(){let a = MyEnum::A(None);// The actual outputassert_eq!("{\"key\":\"A\",\"value\":null}",
serde_json::to_string(&a).unwrap());// The expected outputassert_eq!("{\"key\":\"A\"}", serde_json::to_string(&a).unwrap());}
The text was updated successfully, but these errors were encountered:
Here is an example showing the actual and expected output:
The text was updated successfully, but these errors were encountered: