diff --git a/src/config.rs b/src/config.rs index 44cf11a..1f1d530 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,4 @@ use serde_json::Value; -use std::fmt::format; #[derive(Debug)] pub struct GotifySettings { diff --git a/src/notification.rs b/src/notification.rs index f48fa51..73e7367 100644 --- a/src/notification.rs +++ b/src/notification.rs @@ -12,7 +12,7 @@ pub async fn notify(msg: &str, title: &str, config: Data) { async fn gotify_notification(msg: &str, title: &str, config: config::GotifySettings) { info!("Sending gotify notification"); let c = reqwest::Client::new(); - let res = c + let _ = c .post(format!( "https://{}/message?token={}", config.host, config.token diff --git a/src/pages/func.rs b/src/pages/func.rs index 3afd01b..9f8f44a 100644 --- a/src/pages/func.rs +++ b/src/pages/func.rs @@ -1,5 +1,3 @@ -use reqwest::get; - pub fn is_browser(req: &actix_web::HttpRequest) -> bool { let ua = req .headers() diff --git a/src/pages/html_fn.rs b/src/pages/html_fn.rs index 98d5ee2..bc8c37e 100644 --- a/src/pages/html_fn.rs +++ b/src/pages/html_fn.rs @@ -1,4 +1,3 @@ -use crate::config; use crate::config::Config; use actix_web::web::Data; use actix_web::*; diff --git a/src/pages/index.rs b/src/pages/index.rs index d2bb8bc..9becdbc 100644 --- a/src/pages/index.rs +++ b/src/pages/index.rs @@ -1,10 +1,8 @@ -use crate::pages::html_fn::build_site; use crate::{config, pages}; use actix_web::http::header; -use actix_web::web::{Form, Json}; +use actix_web::web::Form; use actix_web::*; use serde::{Deserialize, Serialize}; -use std::io::Read; #[derive(Serialize, Deserialize, Debug)] pub struct MessageForm { @@ -21,9 +19,10 @@ pub async fn message_post(r: HttpRequest, f: Form) -> impl Responde &format!("New Message from {}", f.msg_name.to_string()), "New Message", config.clone(), - ); + ) + .await; return HttpResponse::Found() - .header("Location", "/message") + .append_header(("Location", "/message")) .finish(); }