From 0450c27fbf438fd21139937b21e481fa06b9ba85 Mon Sep 17 00:00:00 2001 From: Quaternion Date: Fri, 26 May 2023 09:58:13 -0400 Subject: [PATCH] Serde_repr on ChannelType --- Cargo.toml | 1 + src/types/entities/channel.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 53489ce..19c5fdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" tokio = {version = "1.28.1", features = ["rt", "macros", "rt-multi-thread", "full"]} serde = {version = "1.0.162", features = ["derive"]} serde_json = { version = "1.0.96", features = ["raw_value"] } +serde_repr = "0.1.12" reqwest = {version = "0.11.16", features = ["multipart"]} url = "2.3.1" chrono = {version = "0.4.24", features = ["serde"]} diff --git a/src/types/entities/channel.rs b/src/types/entities/channel.rs index 0b4d9f2..d5c9ebb 100644 --- a/src/types/entities/channel.rs +++ b/src/types/entities/channel.rs @@ -1,4 +1,5 @@ use serde::{Deserialize, Serialize}; +use serde_repr::{Deserialize_repr, Serialize_repr}; use crate::types::{ entities::{GuildMember, User}, @@ -87,7 +88,7 @@ pub struct DefaultReaction { pub emoji_name: Option, } -#[derive(Default, Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Default, Clone, Copy, Debug, Serialize_repr, Deserialize_repr, PartialEq, Eq)] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] #[repr(i32)] pub enum ChannelType {