From 659bad02c9a23543c80f5b1d8ffd38660e0683df Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Wed, 3 Feb 2021 17:21:23 -0500 Subject: [PATCH] Fix clippy warnings --- src/data/mod.rs | 2 +- src/files.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/mod.rs b/src/data/mod.rs index 1e6b243..922d083 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -48,7 +48,7 @@ impl FromRequest for Claims { fn from_request(req: &HttpRequest, _payload: &mut dev::Payload) -> Self::Future { let claims = match req.headers().get(header::AUTHORIZATION) { - Some(header) => Claims::from_str(header.to_str().unwrap_or_else(|_| "")), + Some(header) => Claims::from_str(header.to_str().unwrap_or("")), None => Err(jsonwebtoken::errors::Error::from( jsonwebtoken::errors::ErrorKind::InvalidToken, )), diff --git a/src/files.rs b/src/files.rs index b23b19a..0dc9ea7 100644 --- a/src/files.rs +++ b/src/files.rs @@ -27,7 +27,7 @@ fn is_image_or_video(path: &Path) -> bool { .extension() .unwrap_or_else(|| OsStr::new("")) .to_str() - .unwrap_or_else(|| "") + .unwrap_or("") .to_lowercase(); extension == "png"