Remove empty generics lists, wheres and ', ' after self

This commit is contained in:
Waffle 2020-11-24 20:30:45 +03:00
parent d7d8bc6246
commit 7c9c871b83
3 changed files with 26 additions and 23 deletions

View file

@ -1709,7 +1709,7 @@ impl Requester for Bot {
type GetUpdates = JsonRequest<payloads::GetUpdates>; type GetUpdates = JsonRequest<payloads::GetUpdates>;
fn get_updates(&self) -> Self::GetUpdates where { fn get_updates(&self) -> Self::GetUpdates {
Self::GetUpdates::new(self.clone(), payloads::GetUpdates::new()) Self::GetUpdates::new(self.clone(), payloads::GetUpdates::new())
} }
@ -1725,19 +1725,19 @@ impl Requester for Bot {
type DeleteWebhook = JsonRequest<payloads::DeleteWebhook>; type DeleteWebhook = JsonRequest<payloads::DeleteWebhook>;
fn delete_webhook(&self) -> Self::DeleteWebhook where { fn delete_webhook(&self) -> Self::DeleteWebhook {
Self::DeleteWebhook::new(self.clone(), payloads::DeleteWebhook::new()) Self::DeleteWebhook::new(self.clone(), payloads::DeleteWebhook::new())
} }
type GetWebhookInfo = JsonRequest<payloads::GetWebhookInfo>; type GetWebhookInfo = JsonRequest<payloads::GetWebhookInfo>;
fn get_webhook_info(&self) -> Self::GetWebhookInfo where { fn get_webhook_info(&self) -> Self::GetWebhookInfo {
Self::GetWebhookInfo::new(self.clone(), payloads::GetWebhookInfo::new()) Self::GetWebhookInfo::new(self.clone(), payloads::GetWebhookInfo::new())
} }
type GetMe = JsonRequest<payloads::GetMe>; type GetMe = JsonRequest<payloads::GetMe>;
fn get_me(&self) -> Self::GetMe where { fn get_me(&self) -> Self::GetMe {
Self::GetMe::new(self.clone(), payloads::GetMe::new()) Self::GetMe::new(self.clone(), payloads::GetMe::new())
} }
@ -2029,7 +2029,7 @@ impl Requester for Bot {
type GetUserProfilePhotos = JsonRequest<payloads::GetUserProfilePhotos>; type GetUserProfilePhotos = JsonRequest<payloads::GetUserProfilePhotos>;
fn get_user_profile_photos(&self, user_id: i32) -> Self::GetUserProfilePhotos where { fn get_user_profile_photos(&self, user_id: i32) -> Self::GetUserProfilePhotos {
Self::GetUserProfilePhotos::new(self.clone(), payloads::GetUserProfilePhotos::new(user_id)) Self::GetUserProfilePhotos::new(self.clone(), payloads::GetUserProfilePhotos::new(user_id))
} }
@ -2280,7 +2280,7 @@ impl Requester for Bot {
type GetMyCommands = JsonRequest<payloads::GetMyCommands>; type GetMyCommands = JsonRequest<payloads::GetMyCommands>;
fn get_my_commands(&self) -> Self::GetMyCommands where { fn get_my_commands(&self) -> Self::GetMyCommands {
Self::GetMyCommands::new(self.clone(), payloads::GetMyCommands::new()) Self::GetMyCommands::new(self.clone(), payloads::GetMyCommands::new())
} }

View file

@ -367,7 +367,7 @@ macro_rules! impl_payload {
} }
#[macro_use] #[macro_use]
// This macro is auto generated by `cg` <https://github.com/teloxide/cg> (fea4d31). // This macro is auto generated by `cg` <https://github.com/teloxide/cg> (a8fa55a).
// **DO NOT EDIT THIS MACRO**, // **DO NOT EDIT THIS MACRO**,
// edit `cg` instead. // edit `cg` instead.
macro_rules! requester_forward { macro_rules! requester_forward {
@ -377,10 +377,12 @@ macro_rules! requester_forward {
requester_forward!(@method $rest $body $ty); requester_forward!(@method $rest $body $ty);
)* )*
}; };
(@method get_updates $body:ident $ty:ident) => { (@method get_updates $body:ident $ty:ident) => {
type GetUpdates = $ty![GetUpdates]; type GetUpdates = $ty![GetUpdates];
fn get_updates<>(&self, ) -> Self::GetUpdates where { fn get_updates(&self) -> Self::GetUpdates {
let this = self; let this = self;
$body!(get_updates this ()) $body!(get_updates this ())
} }
@ -397,7 +399,7 @@ macro_rules! requester_forward {
(@method delete_webhook $body:ident $ty:ident) => { (@method delete_webhook $body:ident $ty:ident) => {
type DeleteWebhook = $ty![DeleteWebhook]; type DeleteWebhook = $ty![DeleteWebhook];
fn delete_webhook<>(&self, ) -> Self::DeleteWebhook where { fn delete_webhook(&self) -> Self::DeleteWebhook {
let this = self; let this = self;
$body!(delete_webhook this ()) $body!(delete_webhook this ())
} }
@ -405,7 +407,7 @@ macro_rules! requester_forward {
(@method get_webhook_info $body:ident $ty:ident) => { (@method get_webhook_info $body:ident $ty:ident) => {
type GetWebhookInfo = $ty![GetWebhookInfo]; type GetWebhookInfo = $ty![GetWebhookInfo];
fn get_webhook_info<>(&self, ) -> Self::GetWebhookInfo where { fn get_webhook_info(&self) -> Self::GetWebhookInfo {
let this = self; let this = self;
$body!(get_webhook_info this ()) $body!(get_webhook_info this ())
} }
@ -413,7 +415,7 @@ macro_rules! requester_forward {
(@method get_me $body:ident $ty:ident) => { (@method get_me $body:ident $ty:ident) => {
type GetMe = $ty![GetMe]; type GetMe = $ty![GetMe];
fn get_me<>(&self, ) -> Self::GetMe where { fn get_me(&self) -> Self::GetMe {
let this = self; let this = self;
$body!(get_me this ()) $body!(get_me this ())
} }
@ -594,7 +596,7 @@ macro_rules! requester_forward {
(@method get_user_profile_photos $body:ident $ty:ident) => { (@method get_user_profile_photos $body:ident $ty:ident) => {
type GetUserProfilePhotos = $ty![GetUserProfilePhotos]; type GetUserProfilePhotos = $ty![GetUserProfilePhotos];
fn get_user_profile_photos<>(&self, user_id: i32) -> Self::GetUserProfilePhotos where { fn get_user_profile_photos(&self, user_id: i32) -> Self::GetUserProfilePhotos {
let this = self; let this = self;
$body!(get_user_profile_photos this (user_id: i32)) $body!(get_user_profile_photos this (user_id: i32))
} }
@ -789,7 +791,7 @@ macro_rules! requester_forward {
(@method get_my_commands $body:ident $ty:ident) => { (@method get_my_commands $body:ident $ty:ident) => {
type GetMyCommands = $ty![GetMyCommands]; type GetMyCommands = $ty![GetMyCommands];
fn get_my_commands<>(&self, ) -> Self::GetMyCommands where { fn get_my_commands(&self) -> Self::GetMyCommands {
let this = self; let this = self;
$body!(get_my_commands this ()) $body!(get_my_commands this ())
} }
@ -906,7 +908,7 @@ macro_rules! requester_forward {
(@method upload_sticker_file $body:ident $ty:ident) => { (@method upload_sticker_file $body:ident $ty:ident) => {
type UploadStickerFile = $ty![UploadStickerFile]; type UploadStickerFile = $ty![UploadStickerFile];
fn upload_sticker_file<>(&self, user_id: i32, png_sticker: InputFile) -> Self::UploadStickerFile where { fn upload_sticker_file(&self, user_id: i32, png_sticker: InputFile) -> Self::UploadStickerFile {
let this = self; let this = self;
$body!(upload_sticker_file this (user_id: i32, png_sticker: InputFile)) $body!(upload_sticker_file this (user_id: i32, png_sticker: InputFile))
} }
@ -937,7 +939,8 @@ macro_rules! requester_forward {
let this = self; let this = self;
$body!(set_sticker_position_in_set this (sticker: S, position: u32)) $body!(set_sticker_position_in_set this (sticker: S, position: u32))
} }
};(@method delete_sticker_from_set $body:ident $ty:ident) => { };
(@method delete_sticker_from_set $body:ident $ty:ident) => {
type DeleteStickerFromSet = $ty![DeleteStickerFromSet]; type DeleteStickerFromSet = $ty![DeleteStickerFromSet];
fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet where S: Into<String> { fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet where S: Into<String> {

View file

@ -16,14 +16,14 @@ use crate::{
pub trait Requester { pub trait Requester {
type Err: std::error::Error + Send; type Err: std::error::Error + Send;
// This block is auto generated by `cg` <https://github.com/teloxide/cg> (fea4d31). // This block is auto generated by `cg` <https://github.com/teloxide/cg> (a8fa55a).
// **DO NOT EDIT THIS BLOCK**, // **DO NOT EDIT THIS BLOCK**,
// edit `cg` instead. // edit `cg` instead.
type GetUpdates: Request<Payload = GetUpdates, Err = Self::Err>; type GetUpdates: Request<Payload = GetUpdates, Err = Self::Err>;
/// For telegram documentation see [`GetUpdates`] /// For telegram documentation see [`GetUpdates`]
fn get_updates(&self) -> Self::GetUpdates where; fn get_updates(&self) -> Self::GetUpdates;
type SetWebhook: Request<Payload = SetWebhook, Err = Self::Err>; type SetWebhook: Request<Payload = SetWebhook, Err = Self::Err>;
@ -36,17 +36,17 @@ pub trait Requester {
type DeleteWebhook: Request<Payload = DeleteWebhook, Err = Self::Err>; type DeleteWebhook: Request<Payload = DeleteWebhook, Err = Self::Err>;
/// For telegram documentation see [`DeleteWebhook`] /// For telegram documentation see [`DeleteWebhook`]
fn delete_webhook(&self) -> Self::DeleteWebhook where; fn delete_webhook(&self) -> Self::DeleteWebhook;
type GetWebhookInfo: Request<Payload = GetWebhookInfo, Err = Self::Err>; type GetWebhookInfo: Request<Payload = GetWebhookInfo, Err = Self::Err>;
/// For telegram documentation see [`GetWebhookInfo`] /// For telegram documentation see [`GetWebhookInfo`]
fn get_webhook_info(&self) -> Self::GetWebhookInfo where; fn get_webhook_info(&self) -> Self::GetWebhookInfo;
type GetMe: Request<Payload = GetMe, Err = Self::Err>; type GetMe: Request<Payload = GetMe, Err = Self::Err>;
/// For telegram documentation see [`GetMe`] /// For telegram documentation see [`GetMe`]
fn get_me(&self) -> Self::GetMe where; fn get_me(&self) -> Self::GetMe;
type SendMessage: Request<Payload = SendMessage, Err = Self::Err>; type SendMessage: Request<Payload = SendMessage, Err = Self::Err>;
@ -266,7 +266,7 @@ pub trait Requester {
type GetUserProfilePhotos: Request<Payload = GetUserProfilePhotos, Err = Self::Err>; type GetUserProfilePhotos: Request<Payload = GetUserProfilePhotos, Err = Self::Err>;
/// For telegram documentation see [`GetUserProfilePhotos`] /// For telegram documentation see [`GetUserProfilePhotos`]
fn get_user_profile_photos(&self, user_id: i32) -> Self::GetUserProfilePhotos where; fn get_user_profile_photos(&self, user_id: i32) -> Self::GetUserProfilePhotos;
type GetFile: Request<Payload = GetFile, Err = Self::Err>; type GetFile: Request<Payload = GetFile, Err = Self::Err>;
@ -456,7 +456,7 @@ pub trait Requester {
type GetMyCommands: Request<Payload = GetMyCommands, Err = Self::Err>; type GetMyCommands: Request<Payload = GetMyCommands, Err = Self::Err>;
/// For telegram documentation see [`GetMyCommands`] /// For telegram documentation see [`GetMyCommands`]
fn get_my_commands(&self) -> Self::GetMyCommands where; fn get_my_commands(&self) -> Self::GetMyCommands;
type AnswerInlineQuery: Request<Payload = AnswerInlineQuery, Err = Self::Err>; type AnswerInlineQuery: Request<Payload = AnswerInlineQuery, Err = Self::Err>;
@ -594,7 +594,7 @@ pub trait Requester {
type UploadStickerFile: Request<Payload = UploadStickerFile, Err = Self::Err>; type UploadStickerFile: Request<Payload = UploadStickerFile, Err = Self::Err>;
/// For telegram documentation see [`UploadStickerFile`] /// For telegram documentation see [`UploadStickerFile`]
fn upload_sticker_file(&self, user_id: i32, png_sticker: InputFile) -> Self::UploadStickerFile where; fn upload_sticker_file(&self, user_id: i32, png_sticker: InputFile) -> Self::UploadStickerFile;
type CreateNewStickerSet: Request<Payload = CreateNewStickerSet, Err = Self::Err>; type CreateNewStickerSet: Request<Payload = CreateNewStickerSet, Err = Self::Err>;