From 1b526f4c1fdcecaa661d57c3be623ce77e28be73 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 6 Jun 2020 22:24:33 -0500 Subject: [PATCH] Remove redundant code --- src/upload_manager.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/upload_manager.rs b/src/upload_manager.rs index 2b17365..a300439 100644 --- a/src/upload_manager.rs +++ b/src/upload_manager.rs @@ -203,19 +203,12 @@ impl UploadManager { (img, format) }; - let format = self + let (format, content_type) = self .inner .format .as_ref() - .map(|f| f.to_image_format()) - .unwrap_or(format); - - let content_type = self - .inner - .format - .as_ref() - .map(|f| f.to_mime()) - .unwrap_or(content_type); + .map(|f| (f.to_image_format(), f.to_mime())) + .unwrap_or((format, content_type)); let bytes: bytes::Bytes = { let mut bytes = std::io::Cursor::new(vec![]);