From 25db4901e23281fc857969a7c22502c874ac4ba4 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Sun, 10 Oct 2021 16:40:31 +0300 Subject: [PATCH 1/2] Mark `ApiError` as `non_exhaustive` --- src/errors.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/errors.rs b/src/errors.rs index 9fd05a58..92141876 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -61,6 +61,7 @@ pub enum RequestError { /// A kind of an API error. #[derive(Debug, Deserialize, PartialEq, Hash, Eq, Clone)] #[serde(field_identifier)] +#[non_exhaustive] pub enum ApiError { /// Occurs when the bot tries to send message to user who blocked the bot. #[serde(rename = "Forbidden: bot was blocked by the user")] From 0999efa96b2d3316331e3584ca244801b9cebe4c Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Mon, 11 Oct 2021 10:44:06 +0300 Subject: [PATCH 2/2] Update to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae179b83..5ef432d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,8 +20,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Use `url::Url` for urls, use `chrono::DateTime` for dates in types ([#115][pr115]) +- Mark `ApiError` as `non_exhaustive` ([#125][pr125]) [pr115]: https://github.com/teloxide/teloxide-core/pull/115 +[pr125]: https://github.com/teloxide/teloxide-core/pull/125 ### Fixed