chore: Fix clippy warnings

This commit is contained in:
Ashhhleyyy 2022-07-05 14:46:51 +01:00
parent 503324fe5c
commit 0a0e3e1ac3
Signed by: ash
GPG key ID: 83B789081A0878FB
2 changed files with 2 additions and 5 deletions

View file

@ -23,9 +23,6 @@ impl ShareFile {
} }
pub fn is_image(&self) -> bool { pub fn is_image(&self) -> bool {
match self { matches!(self, ShareFile::Image(_))
ShareFile::Image(_) => true,
_ => false,
}
} }
} }

View file

@ -8,7 +8,7 @@ pub trait TemplateRenderer {
impl TemplateRenderer for Tera { impl TemplateRenderer for Tera {
fn response(&self, name: &str, context: tera::Context) -> Result<Html<String>, StatusCode> { fn response(&self, name: &str, context: tera::Context) -> Result<Html<String>, StatusCode> {
let result = self.render(name, &context); 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); tracing::error!("failed to render template {:?}", e);
StatusCode::INTERNAL_SERVER_ERROR StatusCode::INTERNAL_SERVER_ERROR
}) })