From cdc2f0a13ac672a31b8d21eca0c9fc296d452f1e Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 5 Jul 2020 22:04:30 -0700 Subject: [PATCH] exposed more funcs as needed --- server/src/channels.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/channels.rs b/server/src/channels.rs index 687b6dc..ec55b24 100644 --- a/server/src/channels.rs +++ b/server/src/channels.rs @@ -9,7 +9,7 @@ use mysql_async::prelude::{params, Queryable}; use serde_json::Value; -enum ChannelType { +pub enum ChannelType { Voice, Text, Undefined @@ -17,14 +17,14 @@ enum ChannelType { impl ChannelType { // These funcs are mainly here to help translation from mysql - fn from_i32(x: i32) -> ChannelType { + pub fn from_i32(x: i32) -> ChannelType { match x { 1 => ChannelType::Voice, 2 => ChannelType::Text, _ => ChannelType::Undefined } } - fn as_i32(&self) -> i32 { + pub fn as_i32(&self) -> i32 { match self { ChannelType::Voice => 1, ChannelType::Text => 2, @@ -34,7 +34,7 @@ impl ChannelType { } // whole ass function exists because serde_json is a walking pos - fn from_i64_opt(x: Option) -> ChannelType { + pub fn from_i64_opt(x: Option) -> ChannelType { if let Some(i) = x { match i { 1 => ChannelType::Voice,