Now forming MessageIds only from &Message to reduce the amount of moving this large type

This commit is contained in:
2023-07-16 17:28:40 +03:00
parent e25460a3d8
commit 1225adefc2
13 changed files with 26 additions and 27 deletions

View File

@ -43,7 +43,7 @@ async fn get_password(
move |bot, msg, db, dialogue, master_pass| {
get_master_pass(bot, msg, db, dialogue, account, master_pass)
},
previous,
&previous,
)))
.await?;
Ok(())
@ -64,7 +64,7 @@ async fn get_login(
move |bot, msg, db, dialogue, password| {
get_password(bot, msg, db, dialogue, name, login, password)
},
previous,
&previous,
)))
.await?;
Ok(())
@ -82,7 +82,7 @@ async fn get_account_name(
dialogue
.update(State::GetLogin(Handler::new(
move |bot, msg, db, dialogue, login| get_login(bot, msg, db, dialogue, name, login),
previous,
&previous,
)))
.await?;
Ok(())
@ -96,7 +96,7 @@ pub async fn add_account(
) -> crate::Result<()> {
let previous = bot.send_message(msg.chat.id, "Send account name").await?;
dialogue
.update(State::GetNewName(Handler::new(get_account_name, previous)))
.update(State::GetNewName(Handler::new(get_account_name, &previous)))
.await?;
Ok(())
}

View File

@ -32,7 +32,7 @@ async fn get_account_name(
dialogue
.update(State::GetMasterPass(Handler::new(
move |bot, msg, db, dialogue, _| get_master_pass(bot, msg, db, dialogue, name),
previous,
&previous,
)))
.await?;
Ok(())
@ -60,7 +60,7 @@ pub async fn delete(
dialogue
.update(State::GetExistingName(Handler::new(
get_account_name,
previous,
&previous,
)))
.await?;
Ok(())

View File

@ -40,7 +40,7 @@ pub async fn delete_all(
dialogue
.update(State::GetMasterPass(Handler::new(
get_master_pass,
previous,
&previous,
)))
.await?;
Ok(())

View File

@ -61,7 +61,7 @@ pub async fn export(bot: Throttle<Bot>, msg: Message, dialogue: MainDialogue) ->
dialogue
.update(State::GetMasterPass(Handler::new(
get_master_pass,
previous,
&previous,
)))
.await?;
Ok(())

View File

@ -47,7 +47,7 @@ async fn get_account_name(
move |bot, msg, db, dialogue, master_pass| {
get_master_pass(bot, msg, db, dialogue, name, master_pass)
},
previous,
&previous,
)))
.await?;
Ok(())
@ -75,7 +75,7 @@ pub async fn get_account(
dialogue
.update(State::GetExistingName(Handler::new(
get_account_name,
previous,
&previous,
)))
.await?;
Ok(())

View File

@ -79,7 +79,7 @@ async fn get_document(
move |bot, msg, db, dialogue, master_pass| {
get_master_pass(bot, msg, db, dialogue, master_pass, user)
},
previous,
&previous,
)))
.await?;
Ok(())
@ -94,7 +94,7 @@ pub async fn import(bot: Throttle<Bot>, msg: Message, dialogue: MainDialogue) ->
)
.await?;
dialogue
.update(State::GetUser(Handler::new(get_document, previous)))
.update(State::GetUser(Handler::new(get_document, &previous)))
.await?;
Ok(())
}

View File

@ -42,7 +42,7 @@ pub async fn set_master_pass(
dialogue
.update(State::GetNewMasterPass(Handler::new(
get_master_pass,
previous,
&previous,
)))
.await?;
Ok(())