From e81a5e3ec3de577034694f9b8c4c1816acda3f81 Mon Sep 17 00:00:00 2001 From: blek Date: Fri, 27 Oct 2023 01:19:30 +1000 Subject: [PATCH] fix compile warnings --- filed/src/web/forms.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/filed/src/web/forms.rs b/filed/src/web/forms.rs index 9748aef..3ce4793 100644 --- a/filed/src/web/forms.rs +++ b/filed/src/web/forms.rs @@ -6,7 +6,7 @@ use std::{collections::HashMap, net::IpAddr}; use askama::Template; -use warp::{Filter, reply::{Reply, json, with_status, html}, reject::Rejection, filters::multipart::FormData, http::StatusCode}; +use warp::{Filter, reply::{Reply, with_status, html}, reject::Rejection, filters::multipart::FormData, http::StatusCode}; use futures_util::TryStreamExt; use bytes::BufMut; use serde::Serialize; @@ -14,7 +14,7 @@ use warp_real_ip::real_ip; use crate::files::{File, lookup::LookupKind, DeleteMode}; -use super::{state::SharedState, pages::{BadActionReq, UploadSuccessPage, self, ErrorPage}, rejection::HttpReject}; +use super::{state::SharedState, pages::{UploadSuccessPage, ErrorPage}, rejection::HttpReject}; #[derive(Debug, Serialize, Clone)] struct FormElement { @@ -22,6 +22,8 @@ struct FormElement { mime: String } impl FormElement { + + #[allow(dead_code)] pub fn as_str_or_reject(self: &Self) -> Result { Ok(String::from_utf8(self.data.clone()).map_err(|err| warp::reject::custom(HttpReject::FromUtf8Error(err)))?) }