From 7c9c871b83af854ab0c90ca9474ccf7978dacd83 Mon Sep 17 00:00:00 2001 From: Waffle Date: Tue, 24 Nov 2020 20:30:45 +0300 Subject: [PATCH] Remove empty generics lists, `where`s and ', ' after `self` --- src/bot/api.rs | 12 ++++++------ src/local_macros.rs | 21 ++++++++++++--------- src/requests/requester.rs | 16 ++++++++-------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/bot/api.rs b/src/bot/api.rs index 8427ddba..fa7c5d2d 100644 --- a/src/bot/api.rs +++ b/src/bot/api.rs @@ -1709,7 +1709,7 @@ impl Requester for Bot { type GetUpdates = JsonRequest; - fn get_updates(&self) -> Self::GetUpdates where { + fn get_updates(&self) -> Self::GetUpdates { Self::GetUpdates::new(self.clone(), payloads::GetUpdates::new()) } @@ -1725,19 +1725,19 @@ impl Requester for Bot { type DeleteWebhook = JsonRequest; - fn delete_webhook(&self) -> Self::DeleteWebhook where { + fn delete_webhook(&self) -> Self::DeleteWebhook { Self::DeleteWebhook::new(self.clone(), payloads::DeleteWebhook::new()) } type GetWebhookInfo = JsonRequest; - fn get_webhook_info(&self) -> Self::GetWebhookInfo where { + fn get_webhook_info(&self) -> Self::GetWebhookInfo { Self::GetWebhookInfo::new(self.clone(), payloads::GetWebhookInfo::new()) } type GetMe = JsonRequest; - fn get_me(&self) -> Self::GetMe where { + fn get_me(&self) -> Self::GetMe { Self::GetMe::new(self.clone(), payloads::GetMe::new()) } @@ -2029,7 +2029,7 @@ impl Requester for Bot { type GetUserProfilePhotos = JsonRequest; - 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)) } @@ -2280,7 +2280,7 @@ impl Requester for Bot { type GetMyCommands = JsonRequest; - fn get_my_commands(&self) -> Self::GetMyCommands where { + fn get_my_commands(&self) -> Self::GetMyCommands { Self::GetMyCommands::new(self.clone(), payloads::GetMyCommands::new()) } diff --git a/src/local_macros.rs b/src/local_macros.rs index fc522950..83bf0f57 100644 --- a/src/local_macros.rs +++ b/src/local_macros.rs @@ -367,7 +367,7 @@ macro_rules! impl_payload { } #[macro_use] -// This macro is auto generated by `cg` (fea4d31). +// This macro is auto generated by `cg` (a8fa55a). // **DO NOT EDIT THIS MACRO**, // edit `cg` instead. macro_rules! requester_forward { @@ -377,10 +377,12 @@ macro_rules! requester_forward { requester_forward!(@method $rest $body $ty); )* }; + + (@method get_updates $body:ident $ty:ident) => { type GetUpdates = $ty![GetUpdates]; - fn get_updates<>(&self, ) -> Self::GetUpdates where { + fn get_updates(&self) -> Self::GetUpdates { let this = self; $body!(get_updates this ()) } @@ -397,7 +399,7 @@ macro_rules! requester_forward { (@method delete_webhook $body:ident $ty:ident) => { type DeleteWebhook = $ty![DeleteWebhook]; - fn delete_webhook<>(&self, ) -> Self::DeleteWebhook where { + fn delete_webhook(&self) -> Self::DeleteWebhook { let this = self; $body!(delete_webhook this ()) } @@ -405,7 +407,7 @@ macro_rules! requester_forward { (@method get_webhook_info $body:ident $ty:ident) => { type GetWebhookInfo = $ty![GetWebhookInfo]; - fn get_webhook_info<>(&self, ) -> Self::GetWebhookInfo where { + fn get_webhook_info(&self) -> Self::GetWebhookInfo { let this = self; $body!(get_webhook_info this ()) } @@ -413,7 +415,7 @@ macro_rules! requester_forward { (@method get_me $body:ident $ty:ident) => { type GetMe = $ty![GetMe]; - fn get_me<>(&self, ) -> Self::GetMe where { + fn get_me(&self) -> Self::GetMe { let this = self; $body!(get_me this ()) } @@ -594,7 +596,7 @@ macro_rules! requester_forward { (@method get_user_profile_photos $body:ident $ty:ident) => { 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; $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) => { type GetMyCommands = $ty![GetMyCommands]; - fn get_my_commands<>(&self, ) -> Self::GetMyCommands where { + fn get_my_commands(&self) -> Self::GetMyCommands { let this = self; $body!(get_my_commands this ()) } @@ -906,7 +908,7 @@ macro_rules! requester_forward { (@method upload_sticker_file $body:ident $ty:ident) => { 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; $body!(upload_sticker_file this (user_id: i32, png_sticker: InputFile)) } @@ -937,7 +939,8 @@ macro_rules! requester_forward { let this = self; $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]; fn delete_sticker_from_set(&self, sticker: S) -> Self::DeleteStickerFromSet where S: Into { diff --git a/src/requests/requester.rs b/src/requests/requester.rs index 573ab79f..5352ab35 100644 --- a/src/requests/requester.rs +++ b/src/requests/requester.rs @@ -16,14 +16,14 @@ use crate::{ pub trait Requester { type Err: std::error::Error + Send; - // This block is auto generated by `cg` (fea4d31). + // This block is auto generated by `cg` (a8fa55a). // **DO NOT EDIT THIS BLOCK**, // edit `cg` instead. type GetUpdates: Request; /// For telegram documentation see [`GetUpdates`] - fn get_updates(&self) -> Self::GetUpdates where; + fn get_updates(&self) -> Self::GetUpdates; type SetWebhook: Request; @@ -36,17 +36,17 @@ pub trait Requester { type DeleteWebhook: Request; /// For telegram documentation see [`DeleteWebhook`] - fn delete_webhook(&self) -> Self::DeleteWebhook where; + fn delete_webhook(&self) -> Self::DeleteWebhook; type GetWebhookInfo: Request; /// For telegram documentation see [`GetWebhookInfo`] - fn get_webhook_info(&self) -> Self::GetWebhookInfo where; + fn get_webhook_info(&self) -> Self::GetWebhookInfo; type GetMe: Request; /// For telegram documentation see [`GetMe`] - fn get_me(&self) -> Self::GetMe where; + fn get_me(&self) -> Self::GetMe; type SendMessage: Request; @@ -266,7 +266,7 @@ pub trait Requester { type GetUserProfilePhotos: Request; /// 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; @@ -456,7 +456,7 @@ pub trait Requester { type GetMyCommands: Request; /// For telegram documentation see [`GetMyCommands`] - fn get_my_commands(&self) -> Self::GetMyCommands where; + fn get_my_commands(&self) -> Self::GetMyCommands; type AnswerInlineQuery: Request; @@ -594,7 +594,7 @@ pub trait Requester { type UploadStickerFile: Request; /// 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;