Minor cleanup
This commit is contained in:
parent
8ee9acc12b
commit
fba2bb0b86
@ -8,7 +8,6 @@ use entity::prelude::*;
|
||||
use futures::TryStreamExt;
|
||||
use parking_lot::Mutex;
|
||||
use sea_orm::DatabaseConnection;
|
||||
use serde_json::to_vec_pretty;
|
||||
use std::sync::Arc;
|
||||
use teloxide::{adaptors::Throttle, prelude::*, types::InputFile};
|
||||
use tokio::task::spawn_blocking;
|
||||
@ -52,7 +51,7 @@ async fn get_master_pass(
|
||||
|
||||
accounts.sort_unstable_by(|this, other| this.name.cmp(&other.name));
|
||||
|
||||
let json = to_vec_pretty(&User { accounts })?;
|
||||
let json = serde_json::to_vec_pretty(&User { accounts })?;
|
||||
let file = InputFile::memory(json).file_name("accounts.json");
|
||||
|
||||
bot.send_document(msg.chat.id, file)
|
||||
@ -69,9 +68,7 @@ pub async fn export(bot: Throttle<Bot>, msg: Message, dialogue: MainDialogue) ->
|
||||
.await?;
|
||||
dialogue
|
||||
.update(State::GetMasterPass(Handler::new(
|
||||
move |bot, msg, db, dialogue, master_pass| {
|
||||
get_master_pass(bot, msg, db, dialogue, master_pass)
|
||||
},
|
||||
get_master_pass,
|
||||
previous,
|
||||
)))
|
||||
.await?;
|
||||
|
@ -52,6 +52,7 @@ impl DecryptedAccount {
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[repr(transparent)]
|
||||
pub struct User {
|
||||
pub accounts: Vec<DecryptedAccount>,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user