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