From edde4b129909c5bf7690b3cbda248a5de5811cbe Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Thu, 2 May 2024 23:27:53 +0200 Subject: [PATCH] extract to twba-common --- Cargo.lock | 5 +++-- src/main.rs | 7 +------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 715fee3..96eef0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3387,9 +3387,10 @@ dependencies = [ [[package]] name = "twba-common" -version = "0.2.2" -source = "git+https://github.com/OMGeeky/twba.common.git#f5e537c3a3d70a6f21ac1b354ae390ecba7bb057" +version = "0.2.3" +source = "git+https://github.com/OMGeeky/twba.common.git#3e502063cc36b06c0d2aa41bddd89f999f35d6e8" dependencies = [ + "serde", "tracing", "tracing-appender", "tracing-subscriber", diff --git a/src/main.rs b/src/main.rs index 5a3336b..a43b8fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,11 +11,6 @@ struct NotificationWebhookMessage { content: String, } -#[derive(Clone, Debug, Deserialize, Serialize)] -struct NotificationRequest { - message: String, -} - #[get("/")] #[instrument] async fn index() -> impl Responder { @@ -32,7 +27,7 @@ async fn post_notify(req_body: String, data: web::Data) -> impl Respon } async fn post_notify_inner(req_body: String, data: web::Data) -> Result { - let req_body = serde_json::from_str::(&req_body) + let req_body = serde_json::from_str::(&req_body) .map_err(|e| format!("Could not parse request body: {e}")) .map(|req| NotificationWebhookMessage { content: req.message,