From 100679e69d37355f3683df43e58aab21312ea147 Mon Sep 17 00:00:00 2001 From: DCjanus Date: Sat, 11 Jan 2020 23:44:18 +0800 Subject: fix clippy warnings --- askama/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/askama/src/lib.rs b/askama/src/lib.rs index 47f7739..55403c2 100644 --- a/askama/src/lib.rs +++ b/askama/src/lib.rs @@ -544,7 +544,7 @@ pub mod rocket { #[cfg(all(feature = "mime_guess", feature = "mime"))] fn get_mime_type(ext: &str) -> mime_guess::Mime { - let basic_type = mime_guess::get_mime_type(ext); + let basic_type = mime_guess::from_ext(ext).first_or_octet_stream(); for (simple, utf_8) in &TEXT_TYPES { if &basic_type == simple { return utf_8.clone(); @@ -616,7 +616,7 @@ pub mod gotham { match t.render() { Ok(body) => Response::builder() .status(StatusCode::OK) - .header("content-type", mime_type.to_string()) + .header("content-type", mime_type) .body(body.into()) .unwrap(), Err(_) => Response::builder() -- cgit