From de4c4c4268ae0d4db6630eefd8c0fabfd6b64e2e Mon Sep 17 00:00:00 2001 From: j03-dev <24nomeniavo@gmail.com> Date: Sat, 14 Oct 2023 12:43:49 +0300 Subject: [PATCH] Arrange file --- src/response_models/generic.rs | 11 +---------- src/response_models/media.rs | 2 +- src/response_models/mod.rs | 7 ++++++- src/response_models/quick_replies.rs | 2 +- src/response_models/text.rs | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/response_models/generic.rs b/src/response_models/generic.rs index 3717a49..4dbc4df 100644 --- a/src/response_models/generic.rs +++ b/src/response_models/generic.rs @@ -1,10 +1,6 @@ +use super::{payload::Payload, Recipient, SendResponse}; use rocket::serde::Serialize; -use super::{ - payload::Payload, - SendResponse, -}; - #[derive(Serialize)] pub struct GenericButton<'b> { #[serde(rename = "type")] @@ -49,11 +45,6 @@ struct GenericMessage<'m> { pub attachment: Attachment<'m>, } -#[derive(Serialize)] -pub struct Recipient<'r> { - pub id: &'r str, -} - #[derive(Serialize)] pub struct GenericModel<'g> { recipient: Recipient<'g>, diff --git a/src/response_models/media.rs b/src/response_models/media.rs index bc9dc33..44e02f9 100644 --- a/src/response_models/media.rs +++ b/src/response_models/media.rs @@ -1,6 +1,6 @@ use rocket::serde::Serialize; -use super::{generic::Recipient, SendResponse}; +use super::{Recipient, SendResponse}; #[derive(Serialize)] struct MediaPayload<'p> { diff --git a/src/response_models/mod.rs b/src/response_models/mod.rs index ca5b353..82653c1 100644 --- a/src/response_models/mod.rs +++ b/src/response_models/mod.rs @@ -2,12 +2,17 @@ use dotenv::dotenv; use rocket::serde::Serialize; use std::env; -pub mod payload; pub mod generic; pub mod media; +pub mod payload; pub mod quick_replies; pub mod text; +#[derive(Serialize)] +pub struct Recipient<'r> { + pub id: &'r str, +} + #[rocket::async_trait] pub trait SendResponse: Serialize { async fn send(&self) -> Result { diff --git a/src/response_models/quick_replies.rs b/src/response_models/quick_replies.rs index ada3a26..911e9c3 100644 --- a/src/response_models/quick_replies.rs +++ b/src/response_models/quick_replies.rs @@ -1,6 +1,6 @@ use rocket::serde::Serialize; -use super::{generic::Recipient, payload::Payload, SendResponse}; +use super::{payload::Payload, Recipient, SendResponse}; #[derive(Serialize)] pub struct QuickReplie<'r> { diff --git a/src/response_models/text.rs b/src/response_models/text.rs index eb014b2..3ea7ecd 100644 --- a/src/response_models/text.rs +++ b/src/response_models/text.rs @@ -1,6 +1,6 @@ use rocket::serde::Serialize; -use super::{generic::Recipient, SendResponse}; +use super::{Recipient, SendResponse}; #[derive(Serialize)] pub struct Text<'t> {