aboutsummaryrefslogtreecommitdiff
path: root/lib/models/id/channel_id_t.ml
diff options
context:
space:
mode:
authorMatias Goldfeld <[email protected]>2021-01-28 02:26:36 -0500
committerMatias Goldfeld <[email protected]>2021-01-28 02:26:36 -0500
commitc937240fdd2036edd493debb76117165e4084e8b (patch)
treeb0d89ca5795724b3bb804f2d65ee609217567ecd /lib/models/id/channel_id_t.ml
parentMore Int64 refactors (diff)
downloaddisml-c937240fdd2036edd493debb76117165e4084e8b.tar.xz
disml-c937240fdd2036edd493debb76117165e4084e8b.zip
Started conversion to ppx_yojson_conv
Diffstat (limited to 'lib/models/id/channel_id_t.ml')
-rw-r--r--lib/models/id/channel_id_t.ml10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/models/id/channel_id_t.ml b/lib/models/id/channel_id_t.ml
index c6b80ec..74588b1 100644
--- a/lib/models/id/channel_id_t.ml
+++ b/lib/models/id/channel_id_t.ml
@@ -1,15 +1,7 @@
open Core
-type t = [ `Channel_id of Snowflake.t ] [@@deriving sexp]
+type t = [ `Channel_id of Snowflake.t ] [@@deriving sexp, yojson]
let compare (`Channel_id t) (`Channel_id t') = Int64.compare t t'
-let of_yojson a : (t, string) result =
- match Snowflake.of_yojson a with
- | Ok id -> Ok (`Channel_id id)
- | Error err -> Error err
-
-let of_yojson_exn a : t = `Channel_id (Snowflake.of_yojson_exn a)
-let to_yojson (`Channel_id id) = (Snowflake.to_yojson id)
-
let get_id (`Channel_id id) = id \ No newline at end of file