From a87533695f3bede9c50476008c0513bea234c18b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 5 Apr 2021 20:30:29 +0200 Subject: [PATCH] fix(web/converse): Update to use mime_guess::from_path ... instead of its deprecated predecessor. Change-Id: I8af286c6b1ee7c25c153f1209d094ae4f5eb53cc Reviewed-on: https://cl.tvl.fyi/c/depot/+/2860 Tested-by: BuildkiteCI Reviewed-by: tazjin --- web/converse/src/handlers.rs | 3 +-- web/converse/src/main.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/web/converse/src/handlers.rs b/web/converse/src/handlers.rs index d984fc713..c4448c748 100644 --- a/web/converse/src/handlers.rs +++ b/web/converse/src/handlers.rs @@ -32,7 +32,6 @@ use actix_web; use crate::db::*; use crate::errors::ConverseError; use futures::Future; -use mime_guess::guess_mime_type; use crate::models::*; use crate::oidc::*; use crate::render::*; @@ -316,7 +315,7 @@ pub trait EmbeddedFile { impl EmbeddedFile for App { fn static_file(self, path: &'static str, content: &'static [u8]) -> Self { self.route(path, Method::GET, move |_: HttpRequest<_>| { - let mime = format!("{}", guess_mime_type(path)); + let mime = format!("{}", mime_guess::from_path(path).first_or_octet_stream()); HttpResponse::Ok() .content_type(mime.as_str()) .body(content) diff --git a/web/converse/src/main.rs b/web/converse/src/main.rs index 177bdf025..d17626c17 100644 --- a/web/converse/src/main.rs +++ b/web/converse/src/main.rs @@ -16,7 +16,6 @@ // along with this program. If not, see // . -#[macro_use] extern crate askama; #[macro_use]