Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/serde_json/tests/regression/issue520.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / serde_json / tests / regression / issue520.rs` 20 lines ยท 401 bytes Raw Blame History 1 #![allow(clippy::float_cmp)] 2 3 use serde_derive::{Deserialize, Serialize}; 4 5 #[derive(Serialize, Deserialize, Debug)] 6 #[serde(tag = "type", content = "data")] 7 enum E { 8 Float(f32), 9 } 10 11 #[test] 12 fn test() { 13 let e = E::Float(159.1); 14 let v = serde_json::to_value(e).unwrap(); 15 let e = serde_json::from_value::(v).unwrap(); 16 17 match e { 18 E::Float(f) => assert_eq!(f, 159.1), 19 } 20 }