Sha256: f95b362e45c57b431720c48eb47f7ddddf4078195d6859df523dc32950ce980a

Contents?: true

Size: 401 Bytes

Versions: 8

Compression:

Stored size: 401 Bytes

Contents

#![allow(clippy::float_cmp)]

use serde_derive::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
#[serde(tag = "type", content = "data")]
enum E {
    Float(f32),
}

#[test]
fn test() {
    let e = E::Float(159.1);
    let v = serde_json::to_value(e).unwrap();
    let e = serde_json::from_value::<E>(v).unwrap();

    match e {
        E::Float(f) => assert_eq!(f, 159.1),
    }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/serde_json-1.0.137/tests/regression/issue520.rs
wasmtime-28.0.0 ./ext/cargo-vendor/serde_json-1.0.135/tests/regression/issue520.rs
wasmtime-27.0.0 ./ext/cargo-vendor/serde_json-1.0.133/tests/regression/issue520.rs
wasmtime-26.0.0 ./ext/cargo-vendor/serde_json-1.0.132/tests/regression/issue520.rs
wasmtime-25.0.2 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue520.rs
wasmtime-25.0.1 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue520.rs
wasmtime-25.0.0 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue520.rs
wasmtime-24.0.0 ./ext/cargo-vendor/serde_json-1.0.125/tests/regression/issue520.rs