From 4cf72119121f1b6d3f85a5f4279b6fffaf8138e9 Mon Sep 17 00:00:00 2001 From: troido Date: Sun, 2 Feb 2020 21:14:39 +0100 Subject: add worldmessages --- src/util.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/util.rs') diff --git a/src/util.rs b/src/util.rs index 1e7821f..fed0400 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,8 +1,12 @@ use std::cmp::{min, max}; +use serde_json::Value; pub fn clamp(val: T, lower: T, upper: T) -> T{ return max(min(val, upper), lower); } +pub trait ToJson { + fn to_json(&self) -> Value; +} -- cgit