impl ToString for LimitType

This commit is contained in:
bitfl0wer 2023-05-14 13:11:50 +02:00
parent 3de820062b
commit e3c40356bc
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
1 changed files with 18 additions and 1 deletions

View File

@ -1,5 +1,5 @@
pub mod limits {
use std::{collections::HashMap};
use std::collections::HashMap;
use reqwest::Client;
use serde::{Deserialize, Serialize};
@ -20,6 +20,23 @@ pub mod limits {
Webhook,
}
impl ToString for LimitType {
fn to_string(&self) -> String {
match self {
LimitType::AuthRegister => "AuthRegister".to_string(),
LimitType::AuthLogin => "AuthLogin".to_string(),
LimitType::AbsoluteMessage => "AbsoluteMessage".to_string(),
LimitType::AbsoluteRegister => "AbsoluteRegister".to_string(),
LimitType::Global => "Global".to_string(),
LimitType::Ip => "Ip".to_string(),
LimitType::Channel => "Channel".to_string(),
LimitType::Error => "Error".to_string(),
LimitType::Guild => "Guild".to_string(),
LimitType::Webhook => "Webhook".to_string(),
}
}
}
#[derive(Debug, Deserialize, Serialize)]
#[allow(non_snake_case)]
pub struct User {