From dfa260e85abe742aa4dfb2a6f419b0a7870afb07 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Mon, 31 Jul 2023 15:47:27 +0100 Subject: [PATCH] fix: clippy warnings alter updating clippy to clippy 0.1.73 --- src/models/info_hash.rs | 2 +- src/web/api/v1/contexts/torrent/handlers.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/info_hash.rs b/src/models/info_hash.rs index 3925d4a4..342d0fc3 100644 --- a/src/models/info_hash.rs +++ b/src/models/info_hash.rs @@ -195,7 +195,7 @@ impl Ord for InfoHash { impl std::cmp::PartialOrd for InfoHash { fn partial_cmp(&self, other: &InfoHash) -> Option { - self.0.partial_cmp(&other.0) + Some(self.cmp(other)) } } diff --git a/src/web/api/v1/contexts/torrent/handlers.rs b/src/web/api/v1/contexts/torrent/handlers.rs index a3e40327..85bbd1f9 100644 --- a/src/web/api/v1/contexts/torrent/handlers.rs +++ b/src/web/api/v1/contexts/torrent/handlers.rs @@ -309,7 +309,7 @@ async fn get_torrent_request_from_payload(mut payload: Multipart) -> Result = vec![]; while let Some(mut field) = payload.next_field().await.unwrap() { - let name = field.name().unwrap().clone(); + let name = field.name().unwrap(); match name { "title" => { @@ -342,7 +342,7 @@ async fn get_torrent_request_from_payload(mut payload: Multipart) -> Result { - let content_type = field.content_type().unwrap().clone(); + let content_type = field.content_type().unwrap(); if content_type != "application/x-bittorrent" { return Err(ServiceError::InvalidFileType);