Merge pull request #172 from teloxide/typed_ip_address

Make `WebhookInfo::ip_address` typed
This commit is contained in:
Waffle Maybe 2022-01-30 17:12:26 +03:00 committed by GitHub
commit 58259d6d45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -47,12 +47,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- How forwarded messages are represented ([#151][pr151])
- `RequestError::InvalidJson` now has a `raw` field with raw json for easier debugability ([#150][pr150])
- `ChatPermissions` is now bitflags ([#157][pr157])
- Type of `WebhookInfo::ip_address` from `String` to `std::net::IpAddr` ([#172][pr172])
[pr115]: https://github.com/teloxide/teloxide-core/pull/115
[pr125]: https://github.com/teloxide/teloxide-core/pull/125
[pr134]: https://github.com/teloxide/teloxide-core/pull/134
[pr150]: https://github.com/teloxide/teloxide-core/pull/150
[pr157]: https://github.com/teloxide/teloxide-core/pull/157
[pr172]: https://github.com/teloxide/teloxide-core/pull/172
### Fixed

View file

@ -1,3 +1,5 @@
use std::net::IpAddr;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
@ -19,7 +21,7 @@ pub struct WebhookInfo {
pub pending_update_count: u32,
/// Currently used webhook IP address.
pub ip_address: Option<String>,
pub ip_address: Option<IpAddr>,
/// Time of the most recent error that happened when trying to
/// deliver an update via webhook.