/// Serialize a value using a JSON if this is a debug build, and CBOR otherwise.
Serialize a value using a JSON if this is a debug build, and CBOR otherwise.
Serialize a value using a JSON if this is a debug build and CBOR otherwise .
pub fn serialize<W: Write, T: Serialize>(writer: W, value: &T) -> Result<()> {
    if cfg!(debug_assertions) {
        serde_json::to_writer_pretty(writer, value).into_diagnostic()
    } else {
        ciborium::ser::into_writer(value, writer).into_diagnostic()
    }
}
pub fn serialize < W : Write , T : Serialize > ( writer : W , value : & T ) -> Result < ( ) > { if cfg ! ( debug_assertions ) { serde_json :: to_writer_pretty ( writer , value ) . into_diagnostic ( ) } else { ciborium :: ser :: into_writer ( value , writer ) . into_diagnostic ( ) } }
Serialize a value using a JSON if this is a debug build, and CBOR otherwise.
Serialize a value using a JSON if this is a debug build and CBOR otherwise .
writer
W
value
&T