mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
Remove unecessary serde defaults and remove params from bool setters
This commit is contained in:
parent
31caa3ba04
commit
ca5dddab54
4 changed files with 12 additions and 19 deletions
|
@ -15,14 +15,11 @@ pub struct ChatShared {
|
|||
pub chat_id: ChatId,
|
||||
|
||||
/// Title of the chat, if it was requested.
|
||||
#[serde(default)]
|
||||
pub title: Option<String>,
|
||||
|
||||
/// Username of the chat, if it was requested.
|
||||
#[serde(default)]
|
||||
pub username: Option<String>,
|
||||
|
||||
/// Available sizes of the chat photo, if it was requested.
|
||||
#[serde(default)]
|
||||
pub photo: Option<Vec<PhotoSize>>,
|
||||
}
|
||||
|
|
|
@ -130,22 +130,22 @@ impl KeyboardButtonRequestChat {
|
|||
|
||||
/// Setter for `request_title` field.
|
||||
#[must_use]
|
||||
pub fn request_title(mut self, value: bool) -> Self {
|
||||
self.request_title = value;
|
||||
pub fn request_title(mut self) -> Self {
|
||||
self.request_title = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Setter for `request_username` field.
|
||||
#[must_use]
|
||||
pub fn request_username(mut self, value: bool) -> Self {
|
||||
self.request_username = value;
|
||||
pub fn request_username(mut self) -> Self {
|
||||
self.request_username = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Setter for `request_photo` field.
|
||||
#[must_use]
|
||||
pub fn request_photo(mut self, value: bool) -> Self {
|
||||
self.request_photo = value;
|
||||
pub fn request_photo(mut self) -> Self {
|
||||
self.request_photo = true;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,22 +83,22 @@ impl KeyboardButtonRequestUsers {
|
|||
|
||||
/// Setter for `request_name` field
|
||||
#[must_use]
|
||||
pub fn request_name(mut self, value: bool) -> Self {
|
||||
self.request_name = Some(value);
|
||||
pub fn request_name(mut self) -> Self {
|
||||
self.request_name = Some(true);
|
||||
self
|
||||
}
|
||||
|
||||
/// Setter for `request_username` field
|
||||
#[must_use]
|
||||
pub fn request_username(mut self, value: bool) -> Self {
|
||||
self.request_username = Some(value);
|
||||
pub fn request_username(mut self) -> Self {
|
||||
self.request_username = Some(true);
|
||||
self
|
||||
}
|
||||
|
||||
/// Setter for `request_photo` field
|
||||
#[must_use]
|
||||
pub fn request_photo(mut self, value: bool) -> Self {
|
||||
self.request_photo = Some(value);
|
||||
pub fn request_photo(mut self) -> Self {
|
||||
self.request_photo = Some(true);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,18 +12,14 @@ pub struct SharedUser {
|
|||
pub user_id: UserId,
|
||||
|
||||
/// First name of the user, if it was requested by the bot
|
||||
#[serde(default)]
|
||||
pub first_name: Option<String>,
|
||||
|
||||
/// Last name of the user, if it was requested by the bot
|
||||
#[serde(default)]
|
||||
pub last_name: Option<String>,
|
||||
|
||||
/// Username of the user, if it was requested by the bot
|
||||
#[serde(default)]
|
||||
pub username: Option<String>,
|
||||
|
||||
/// Available sizes of the chat photo, if it was requested
|
||||
#[serde(default)]
|
||||
pub photo: Option<Vec<PhotoSize>>,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue