From 5eccb0f42dd7ea669ba929e6ec8dba17798e8448 Mon Sep 17 00:00:00 2001 From: Magic Len Date: Thu, 11 Mar 2021 21:37:38 +0800 Subject: [PATCH] run clippy --- Cargo.toml | 2 +- src/file_resources.rs | 5 +---- src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index edc2c0e..98cb509 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rocket-include-static-resources" -version = "0.9.5" +version = "0.9.6" authors = ["Magic Len "] edition = "2018" repository = "https://github.com/magiclen/rocket-include-static-resources" diff --git a/src/file_resources.rs b/src/file_resources.rs index e925d72..b9482e4 100644 --- a/src/file_resources.rs +++ b/src/file_resources.rs @@ -53,10 +53,7 @@ impl FileResources { pub fn unregister_resource_file>(&mut self, name: S) -> Option { let name = name.as_ref(); - match self.resources.remove(name) { - Some((file_path, _, _, _, _)) => Some(file_path), - None => None, - } + self.resources.remove(name).map(|(file_path, _, _, _, _)| file_path) } #[inline] diff --git a/src/lib.rs b/src/lib.rs index 50231d9..d8986b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -156,7 +156,7 @@ impl<'a> Responder<'a> for StaticResponse { return response.ok(); } else { - (mime.to_string(), data.clone(), etag.to_string()) + (mime.to_string(), data, etag.to_string()) } } Err(_) => {