refactoring

This commit is contained in:
P0lunin 2019-09-11 10:16:48 +03:00
parent 70e29b4edf
commit eeddf3d54f

View file

@ -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();