Derive PartialEq, Eq and Hash on telegram types

This commit is contained in:
Waffle 2019-09-02 14:24:23 +03:00
parent 65f153734d
commit e1be16fba2
17 changed files with 17 additions and 17 deletions

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct AnswerPreCheckoutQuery {
pub pre_checkout_query_id: String,
pub ok: bool,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::ShippingOption;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct AnswerShippingQuery {
pub shipping_query_id: String,
pub ok: bool,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::{ChatPermissions, ChatPhoto, Message};
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct Chat {
pub id: i64,
pub chat_type: String,

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct ChatPermissions {
pub can_send_messages: Option<bool>,
pub can_send_media_messages: Option<bool>,

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct ChatPhoto {
pub small_file_id: String,
pub big_file_id: String,

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct Document {
pub file_id: String,
pub thumb: Option<PhotoSize>,

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct Invoice {
pub title: String,
pub description: String,

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct LabeledPrice {
pub label: String,
pub amount: i64,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::{Chat, Document, Invoice, SuccessfulPayment, User};
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct Message {
pub message_id: i64,
pub from: Option<Box<User>>,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::ShippingAddress;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct OrderInfo {
pub name: String,
pub phone_number: String,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::{OrderInfo, User};
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct PreCheckoutQuery {
pub id: String,
pub from: User,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::LabeledPrice;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct SendInvoice {
pub chat_id: i64,
pub title: String,

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct ShippingAddress {
pub country_code: String,
pub state: String,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::LabeledPrice;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct ShippingOption {
pub id: i64,
pub title: String,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::{ShippingAddress, User};
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct ShippingQuery {
pub id: String,
pub from: User,

View file

@ -2,7 +2,7 @@ use serde::Deserialize;
use crate::core::types::OrderInfo;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct SuccessfulPayment {
pub currency: String,
pub total_amount: i64,

View file

@ -1,6 +1,6 @@
use serde::Deserialize;
#[derive(Debug, Deserialize)]
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
pub struct User {
pub id: i64,
pub is_bot: bool,