Fix: types fields privacy (make fields of some types public)

The typos were found with `grep`:
```text
; grep -r -P "^    \w{2,}: .+, *$" ./src/types/*
./src/types/dice.rs:    emoji: DiceEmoji,
./src/types/dice.rs:    value: i32,
./src/types/keyboard_button.rs:    contact: Option<True>,
./src/types/keyboard_button.rs:    location: Option<True>,
./src/types/keyboard_button.rs:    poll: Option<KeyboardButtonPollType>,
./src/types/message.rs:    message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged,
./src/types/passport_element_error.rs:    message: String,
./src/types/passport_element_error.rs:    kind: PassportElementErrorKind,
./src/types/sticker_set.rs:    thumb: Option<PhotoSize>,
```

`src/types/keyboard_button.rs` can be ignored since in just contains private
helper structure.

Fields made public:
- `Dice::{emoji, value}`
- `MessageMessageAutoDeleteTimerChanged::message_auto_delete_timer_changed`
- `PassportElementError::{message, kind}`
- `StickerSet::thumb`
This commit is contained in:
Waffle 2021-03-19 12:20:26 +03:00
parent 627841f021
commit f4507bd3d2
5 changed files with 16 additions and 6 deletions

View file

@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased] ## [unreleased]
### Fixed
- Types fields privacy (make fields of some types public) ([#68][pr68])
- `Dice::{emoji, value}`
- `MessageMessageAutoDeleteTimerChanged::message_auto_delete_timer_changed`
- `PassportElementError::{message, kind}`
- `StickerSet::thumb`
[pr68]: https://github.com/teloxide/teloxide-core/pull/68
## [0.2.0] - 2020-03-16 ## [0.2.0] - 2020-03-16
### Changed ### Changed

View file

@ -7,7 +7,7 @@ use crate::types::DiceEmoji;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Dice { pub struct Dice {
/// Emoji on which the dice throw animation is based. /// Emoji on which the dice throw animation is based.
emoji: DiceEmoji, pub emoji: DiceEmoji,
/// Value of the dice. /// Value of the dice.
/// ///
@ -17,5 +17,5 @@ pub struct Dice {
/// [`DiceEmoji::Dice`]: crate::types::DiceEmoji::Dice /// [`DiceEmoji::Dice`]: crate::types::DiceEmoji::Dice
/// [`DiceEmoji::Darts`]:crate::types::DiceEmoji::Darts /// [`DiceEmoji::Darts`]:crate::types::DiceEmoji::Darts
/// [`DiceEmoji::Basketball`]:crate::types::DiceEmoji::Basketball /// [`DiceEmoji::Basketball`]:crate::types::DiceEmoji::Basketball
value: i32, pub value: i32,
} }

View file

@ -151,7 +151,7 @@ pub struct MessageChannelChatCreated {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MessageMessageAutoDeleteTimerChanged { pub struct MessageMessageAutoDeleteTimerChanged {
/// Service message: auto-delete timer settings changed in the chat. /// Service message: auto-delete timer settings changed in the chat.
message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged, pub message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]

View file

@ -7,10 +7,10 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementError { pub struct PassportElementError {
/// Error message. /// Error message.
message: String, pub message: String,
#[serde(flatten)] #[serde(flatten)]
kind: PassportElementErrorKind, pub kind: PassportElementErrorKind,
} }
impl PassportElementError { impl PassportElementError {

View file

@ -25,5 +25,5 @@ pub struct StickerSet {
pub stickers: Vec<Sticker>, pub stickers: Vec<Sticker>,
/// Sticker set thumbnail in the .WEBP or .TGS format. /// Sticker set thumbnail in the .WEBP or .TGS format.
thumb: Option<PhotoSize>, pub thumb: Option<PhotoSize>,
} }