aboutsummaryrefslogtreecommitdiff
path: root/src/common/json.rs
blob: 50bd788c8f2637b324d0a1d5787d953b15e28703 (plain)
1
2
3
4
5
6
7
use serde::Serialize;

pub fn serialize<S: Serialize>(s: S) -> Vec<u8> {
    let mut buffer: Vec<u8> = Vec::new();
    serde_json::to_writer(&mut buffer, &s).unwrap();
    buffer
}