From 0a0e3e1ac305a1e44add7e65acf4b03836468b12 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Tue, 5 Jul 2022 14:46:51 +0100 Subject: [PATCH] chore: Fix clippy warnings --- src/share.rs | 5 +---- src/templates.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/share.rs b/src/share.rs index 5ae52d6..b975468 100644 --- a/src/share.rs +++ b/src/share.rs @@ -23,9 +23,6 @@ impl ShareFile { } pub fn is_image(&self) -> bool { - match self { - ShareFile::Image(_) => true, - _ => false, - } + matches!(self, ShareFile::Image(_)) } } diff --git a/src/templates.rs b/src/templates.rs index 790a519..49cf86d 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -8,7 +8,7 @@ pub trait TemplateRenderer { impl TemplateRenderer for Tera { fn response(&self, name: &str, context: tera::Context) -> Result, StatusCode> { let result = self.render(name, &context); - result.map(|rendered| Html(rendered)).map_err(|e| { + result.map(Html).map_err(|e| { tracing::error!("failed to render template {:?}", e); StatusCode::INTERNAL_SERVER_ERROR })