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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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