Fix Clippy

This commit is contained in:
Temirkhan Myrzamadi 2020-01-03 15:54:26 +06:00
parent 08d11a85d4
commit 69e70b1d0e
9 changed files with 25 additions and 46 deletions

View file

@ -66,15 +66,12 @@ impl<'a> AddStickerToSet<'a> {
N: Into<String>, N: Into<String>,
E: Into<String>, E: Into<String>,
{ {
let name = name.into();
let png_sticker = png_sticker.into();
let emojis = emojis.into();
Self { Self {
bot, bot,
user_id, user_id,
name, name: name.into(),
png_sticker, png_sticker,
emojis, emojis: emojis.into(),
mask_position: None, mask_position: None,
} }
} }
@ -93,7 +90,7 @@ impl<'a> AddStickerToSet<'a> {
} }
pub fn png_sticker(mut self, val: InputFile) -> Self { pub fn png_sticker(mut self, val: InputFile) -> Self {
self.png_sticker = val.into(); self.png_sticker = val;
self self
} }

View file

@ -76,17 +76,13 @@ impl<'a> CreateNewStickerSet<'a> {
T: Into<String>, T: Into<String>,
E: Into<String>, E: Into<String>,
{ {
let name = name.into();
let title = title.into();
let png_sticker = png_sticker.into();
let emojis = emojis.into();
Self { Self {
bot, bot,
user_id, user_id,
name, name: name.into(),
title, title: title.into(),
png_sticker, png_sticker,
emojis, emojis: emojis.into(),
contains_masks: None, contains_masks: None,
mask_position: None, mask_position: None,
} }
@ -114,7 +110,7 @@ impl<'a> CreateNewStickerSet<'a> {
} }
pub fn png_sticker(mut self, val: InputFile) -> Self { pub fn png_sticker(mut self, val: InputFile) -> Self {
self.png_sticker = val.into(); self.png_sticker = val;
self self
} }

View file

@ -87,11 +87,9 @@ impl<'a> SendAudio<'a> {
where where
C: Into<ChatId>, C: Into<ChatId>,
{ {
let chat_id = chat_id.into();
let audio = audio.into();
Self { Self {
bot, bot,
chat_id, chat_id: chat_id.into(),
audio, audio,
caption: None, caption: None,
parse_mode: None, parse_mode: None,
@ -114,7 +112,7 @@ impl<'a> SendAudio<'a> {
} }
pub fn audio(mut self, val: InputFile) -> Self { pub fn audio(mut self, val: InputFile) -> Self {
self.audio = val.into(); self.audio = val;
self self
} }
@ -153,7 +151,7 @@ impl<'a> SendAudio<'a> {
} }
pub fn thumb(mut self, val: InputFile) -> Self { pub fn thumb(mut self, val: InputFile) -> Self {
self.thumb = Some(val.into()); self.thumb = Some(val);
self self
} }

View file

@ -77,11 +77,9 @@ impl<'a> SendDocument<'a> {
where where
C: Into<ChatId>, C: Into<ChatId>,
{ {
let chat_id = chat_id.into();
let document = document.into();
Self { Self {
bot, bot,
chat_id, chat_id: chat_id.into(),
document, document,
thumb: None, thumb: None,
caption: None, caption: None,
@ -101,12 +99,12 @@ impl<'a> SendDocument<'a> {
} }
pub fn document(mut self, val: InputFile) -> Self { pub fn document(mut self, val: InputFile) -> Self {
self.document = val.into(); self.document = val;
self self
} }
pub fn thumb(mut self, val: InputFile) -> Self { pub fn thumb(mut self, val: InputFile) -> Self {
self.thumb = Some(val.into()); self.thumb = Some(val);
self self
} }

View file

@ -65,11 +65,9 @@ impl<'a> SendPhoto<'a> {
where where
C: Into<ChatId>, C: Into<ChatId>,
{ {
let chat_id = chat_id.into();
let photo = photo.into();
Self { Self {
bot, bot,
chat_id, chat_id: chat_id.into(),
photo, photo,
caption: None, caption: None,
parse_mode: None, parse_mode: None,
@ -88,7 +86,7 @@ impl<'a> SendPhoto<'a> {
} }
pub fn photo(mut self, val: InputFile) -> Self { pub fn photo(mut self, val: InputFile) -> Self {
self.photo = val.into(); self.photo = val;
self self
} }

View file

@ -58,11 +58,9 @@ impl<'a> SendSticker<'a> {
where where
C: Into<ChatId>, C: Into<ChatId>,
{ {
let chat_id = chat_id.into();
let sticker = sticker.into();
Self { Self {
bot, bot,
chat_id, chat_id: chat_id.into(),
sticker, sticker,
disable_notification: None, disable_notification: None,
reply_to_message_id: None, reply_to_message_id: None,
@ -79,7 +77,7 @@ impl<'a> SendSticker<'a> {
} }
pub fn sticker(mut self, val: InputFile) -> Self { pub fn sticker(mut self, val: InputFile) -> Self {
self.sticker = val.into(); self.sticker = val;
self self
} }

View file

@ -90,11 +90,9 @@ impl<'a> SendVideo<'a> {
where where
C: Into<ChatId>, C: Into<ChatId>,
{ {
let chat_id = chat_id.into();
let video = video.into();
Self { Self {
bot, bot,
chat_id, chat_id: chat_id.into(),
video, video,
duration: None, duration: None,
width: None, width: None,
@ -118,7 +116,7 @@ impl<'a> SendVideo<'a> {
} }
pub fn video(mut self, val: InputFile) -> Self { pub fn video(mut self, val: InputFile) -> Self {
self.video = val.into(); self.video = val;
self self
} }
@ -138,7 +136,7 @@ impl<'a> SendVideo<'a> {
} }
pub fn thumb(mut self, val: InputFile) -> Self { pub fn thumb(mut self, val: InputFile) -> Self {
self.thumb = Some(val.into()); self.thumb = Some(val);
self self
} }

View file

@ -79,11 +79,9 @@ impl<'a> SendVideoNote<'a> {
where where
C: Into<ChatId>, C: Into<ChatId>,
{ {
let chat_id = chat_id.into();
let video_note = video_note.into();
Self { Self {
bot, bot,
chat_id, chat_id: chat_id.into(),
video_note, video_note,
duration: None, duration: None,
length: None, length: None,
@ -103,7 +101,7 @@ impl<'a> SendVideoNote<'a> {
} }
pub fn video_note(mut self, val: InputFile) -> Self { pub fn video_note(mut self, val: InputFile) -> Self {
self.video_note = val.into(); self.video_note = val;
self self
} }
@ -118,7 +116,7 @@ impl<'a> SendVideoNote<'a> {
} }
pub fn thumb(mut self, val: InputFile) -> Self { pub fn thumb(mut self, val: InputFile) -> Self {
self.thumb = Some(val.into()); self.thumb = Some(val);
self self
} }

View file

@ -72,11 +72,9 @@ impl<'a> SendVoice<'a> {
where where
C: Into<ChatId>, C: Into<ChatId>,
{ {
let chat_id = chat_id.into();
let voice = voice.into();
Self { Self {
bot, bot,
chat_id, chat_id: chat_id.into(),
voice, voice,
caption: None, caption: None,
parse_mode: None, parse_mode: None,
@ -96,7 +94,7 @@ impl<'a> SendVoice<'a> {
} }
pub fn voice(mut self, val: InputFile) -> Self { pub fn voice(mut self, val: InputFile) -> Self {
self.voice = val.into(); self.voice = val;
self self
} }