From 43e1a12b5bce11b4a28a53acca243e35c2be6d3e Mon Sep 17 00:00:00 2001 From: evuez Date: Wed, 3 Apr 2024 22:43:16 +0200 Subject: Initial commit --- src/common/json.rs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/common/json.rs (limited to 'src/common/json.rs') diff --git a/src/common/json.rs b/src/common/json.rs new file mode 100644 index 0000000..50bd788 --- /dev/null +++ b/src/common/json.rs @@ -0,0 +1,7 @@ +use serde::Serialize; + +pub fn serialize(s: S) -> Vec { + let mut buffer: Vec = Vec::new(); + serde_json::to_writer(&mut buffer, &s).unwrap(); + buffer +} -- cgit v1.2.3