summaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs4
1 files changed, 4 insertions, 0 deletions
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<T: Ord>(val: T, lower: T, upper: T) -> T{
return max(min(val, upper), lower);
}
+pub trait ToJson {
+ fn to_json(&self) -> Value;
+}