update teloxide_macros dependency + update examples and tests using BotDialogue derive macro

This commit is contained in:
p0lunin 2022-01-06 14:11:53 +02:00
parent d6e439b0cf
commit ca1c1f3e33
3 changed files with 4 additions and 6 deletions

View file

@ -74,7 +74,7 @@ full = [
teloxide-core = { version = "0.3.3", default-features = false } teloxide-core = { version = "0.3.3", default-features = false }
#teloxide-core = { git = "https://github.com/teloxide/teloxide-core.git", rev = "...", default-features = false } #teloxide-core = { git = "https://github.com/teloxide/teloxide-core.git", rev = "...", default-features = false }
#teloxide-macros = { version = "0.4", optional = true } #teloxide-macros = { version = "0.4", optional = true }
teloxide-macros = { path = "../teloxide-macros", optional = true } teloxide-macros = { git = "https://github.com/teloxide/teloxide-macros", branch = "dispatching2", optional = true }
serde_json = "1.0" serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View file

@ -25,7 +25,7 @@ type Store = SqliteStorage<Json>;
type BotDialogue = Dialogue<State, Store>; type BotDialogue = Dialogue<State, Store>;
#[derive(DialogueState, Clone, serde::Serialize, serde::Deserialize)] #[derive(DialogueState, Clone, serde::Serialize, serde::Deserialize)]
#[out(anyhow::Result<()>)] #[handler_out(anyhow::Result<()>)]
pub enum State { pub enum State {
#[handler(handle_start)] #[handler(handle_start)]
Start, Start,

View file

@ -8,8 +8,7 @@ use teloxide::macros::DialogueState;
fn compile_test() { fn compile_test() {
#[allow(dead_code)] #[allow(dead_code)]
#[derive(DialogueState, Clone)] #[derive(DialogueState, Clone)]
#[out(Result<(), teloxide::RequestError>)] #[handler_out(Result<(), teloxide::RequestError>)]
#[store(teloxide::dispatching2::dialogue::InMemStorage<State>)]
enum State { enum State {
#[handler(handle_start)] #[handler(handle_start)]
Start, Start,
@ -38,8 +37,7 @@ fn compile_test() {
fn compile_test_generics() { fn compile_test_generics() {
#[allow(dead_code)] #[allow(dead_code)]
#[derive(DialogueState, Clone)] #[derive(DialogueState, Clone)]
#[out(Result<(), teloxide::RequestError>)] #[handler_out(Result<(), teloxide::RequestError>)]
#[store(teloxide::dispatching2::dialogue::InMemStorage<State<X>>)]
enum State<X: Clone + Send + Sync + 'static> { enum State<X: Clone + Send + Sync + 'static> {
#[handler(handle_start)] #[handler(handle_start)]
Start, Start,