From eeddf3d54f6941438026ba66fa61211349af0ef2 Mon Sep 17 00:00:00 2001 From: P0lunin Date: Wed, 11 Sep 2019 10:16:48 +0300 Subject: [PATCH] refactoring --- src/core/requests/send_audio.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/requests/send_audio.rs b/src/core/requests/send_audio.rs index e19039d9..7951ec8e 100644 --- a/src/core/requests/send_audio.rs +++ b/src/core/requests/send_audio.rs @@ -82,12 +82,12 @@ impl<'a> Request<'a> for SendAudio<'a> { InputFile::Url(url) => params.add("audio", &url), InputFile::FileId(file_id) => params.add("audio", &file_id), }; - if self.thumb.is_some() { - params = match self.thumb.unwrap() { + if let Some(thumb) = self.thumb { + params = match thumb { InputFile::File(file) => params.add_file("thumb", &file), InputFile::Url(url) => params.add("thumb", &url), InputFile::FileId(file_id) => params.add("thumb", &file_id), - }; + } } let params = params.build();