From 5fa616046cb3c7e0f065afcee3bad859612f74d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 08:36:54 +0000 Subject: [PATCH 1/2] Bump the lock group with 12 updates Bumps the lock group with 12 updates: | Package | From | To | | --- | --- | --- | | [bitflags](https://github.com/bitflags/bitflags) | `1.3.2` | `2.4.2` | | [aho-corasick](https://github.com/BurntSushi/aho-corasick) | `0.7.20` | `1.1.2` | | [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.86` | `1.0.87` | | [syn](https://github.com/dtolnay/syn) | `1.0.109` | `2.0.52` | | [bytemuck](https://github.com/Lokathor/bytemuck) | `1.18.0` | `1.19.0` | | [cc](https://github.com/rust-lang/cc-rs) | `1.1.28` | `1.1.30` | | [futures-executor](https://github.com/rust-lang/futures-rs) | `0.3.30` | `0.3.31` | | [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) | `0.2.93` | `0.2.95` | | [wasm-bindgen-backend](https://github.com/rustwasm/wasm-bindgen) | `0.2.93` | `0.2.95` | | [wasm-bindgen-macro](https://github.com/rustwasm/wasm-bindgen) | `0.2.93` | `0.2.95` | | [wasm-bindgen-macro-support](https://github.com/rustwasm/wasm-bindgen) | `0.2.93` | `0.2.95` | | [wasm-bindgen-shared](https://github.com/rustwasm/wasm-bindgen) | `0.2.93` | `0.2.95` | Updates `bitflags` from 1.3.2 to 2.4.2 - [Release notes](https://github.com/bitflags/bitflags/releases) - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md) - [Commits](https://github.com/bitflags/bitflags/compare/1.3.2...2.4.2) Updates `aho-corasick` from 0.7.20 to 1.1.2 - [Commits](https://github.com/BurntSushi/aho-corasick/compare/0.7.20...1.1.2) Updates `proc-macro2` from 1.0.86 to 1.0.87 - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.86...1.0.87) Updates `syn` from 1.0.109 to 2.0.52 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/1.0.109...2.0.52) Updates `bytemuck` from 1.18.0 to 1.19.0 - [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md) - [Commits](https://github.com/Lokathor/bytemuck/compare/v1.18.0...v1.19.0) Updates `cc` from 1.1.28 to 1.1.30 - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.28...cc-v1.1.30) Updates `futures-executor` from 0.3.30 to 0.3.31 - [Release notes](https://github.com/rust-lang/futures-rs/releases) - [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.30...0.3.31) Updates `wasm-bindgen` from 0.2.93 to 0.2.95 - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.95) Updates `wasm-bindgen-backend` from 0.2.93 to 0.2.95 - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.95) Updates `wasm-bindgen-macro` from 0.2.93 to 0.2.95 - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.95) Updates `wasm-bindgen-macro-support` from 0.2.93 to 0.2.95 - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.95) Updates `wasm-bindgen-shared` from 0.2.93 to 0.2.95 - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.95) --- updated-dependencies: - dependency-name: bitflags dependency-type: direct:production update-type: version-update:semver-major dependency-group: lock - dependency-name: aho-corasick dependency-type: direct:production update-type: version-update:semver-major dependency-group: lock - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: lock - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-major dependency-group: lock - dependency-name: bytemuck dependency-type: indirect update-type: version-update:semver-minor dependency-group: lock - dependency-name: cc dependency-type: indirect update-type: version-update:semver-patch dependency-group: lock - dependency-name: futures-executor dependency-type: indirect update-type: version-update:semver-patch dependency-group: lock - dependency-name: wasm-bindgen dependency-type: indirect update-type: version-update:semver-patch dependency-group: lock - dependency-name: wasm-bindgen-backend dependency-type: indirect update-type: version-update:semver-patch dependency-group: lock - dependency-name: wasm-bindgen-macro dependency-type: indirect update-type: version-update:semver-patch dependency-group: lock - dependency-name: wasm-bindgen-macro-support dependency-type: indirect update-type: version-update:semver-patch dependency-group: lock - dependency-name: wasm-bindgen-shared dependency-type: indirect update-type: version-update:semver-patch dependency-group: lock ... Signed-off-by: dependabot[bot] --- Cargo.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93b84dad..866dcc30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -237,9 +237,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -255,9 +255,9 @@ checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "shlex", ] @@ -655,9 +655,9 @@ checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1452,9 +1452,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -2673,9 +2673,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -2684,9 +2684,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -2711,9 +2711,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2721,9 +2721,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -2734,9 +2734,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" @@ -2786,7 +2786,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] From eee0a374e4d0bdc7d48f26d01fd25036499826bf Mon Sep 17 00:00:00 2001 From: LasterAlex Date: Mon, 14 Oct 2024 21:03:00 +0300 Subject: [PATCH 2/2] Fixed InlineQueryResultsButton serialization --- CHANGELOG.md | 1 + .../src/types/inline_query_results_button.rs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab2c37d5..707bf546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Now Vec in requests serializes into [number] instead of [ {message_id: number} ], `forward_messages`, `copy_messages` and `delete_messages` now work properly +- Now `InlineQueryResultsButton` serializes properly ([issue 1181](https://github.com/teloxide/teloxide/issues/1181)) ## 0.13.0 - 2024-08-16 diff --git a/crates/teloxide-core/src/types/inline_query_results_button.rs b/crates/teloxide-core/src/types/inline_query_results_button.rs index 3219dd0d..d0c5ecec 100644 --- a/crates/teloxide-core/src/types/inline_query_results_button.rs +++ b/crates/teloxide-core/src/types/inline_query_results_button.rs @@ -17,6 +17,7 @@ pub struct InlineQueryResultsButton { } #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] pub enum InlineQueryResultsButtonKind { /// Description of the [Web App] that will be launched when the user presses /// the button. The Web App will be able to switch back to the inline mode @@ -44,3 +45,19 @@ pub enum InlineQueryResultsButtonKind { /// [switch_inline]: https://core.telegram.org/bots/api#inlinekeyboardmarkup StartParameter(String), } + +#[cfg(test)] +mod tests { + use crate::types::{InlineQueryResultsButton, InlineQueryResultsButtonKind}; + + #[test] + fn inline_query_results_button() { + let button = InlineQueryResultsButton { + text: "test".into(), + kind: InlineQueryResultsButtonKind::StartParameter("bot".into()), + }; + let expected = r#"{"text":"test","start_parameter":"bot"}"#; + let actual = serde_json::to_string(&button).unwrap(); + assert_eq!(expected, actual); + } +}