More clippy fixes
This commit is contained in:
@@ -12,15 +12,16 @@ pub async fn get_accounts(
|
||||
) -> crate::Result<()> {
|
||||
let user_id = msg.from().ok_or(NoUserInfo)?.id.0;
|
||||
let mut account_names = Account::get_names(user_id, &db).await?;
|
||||
let mut text = match account_names.try_next().await? {
|
||||
Some(name) => format!("Accounts:\n`{name}`"),
|
||||
None => {
|
||||
bot.send_message(msg.chat.id, "No accounts found")
|
||||
.reply_markup(deletion_markup())
|
||||
.await?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut text = if let Some(name) = account_names.try_next().await? {
|
||||
format!("Accounts:\n`{name}`")
|
||||
} else {
|
||||
bot.send_message(msg.chat.id, "No accounts found")
|
||||
.reply_markup(deletion_markup())
|
||||
.await?;
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
account_names
|
||||
.map_err(crate::Error::from)
|
||||
.try_for_each(|name| {
|
||||
@@ -28,6 +29,7 @@ pub async fn get_accounts(
|
||||
future::ready(result)
|
||||
})
|
||||
.await?;
|
||||
|
||||
bot.send_message(msg.chat.id, text)
|
||||
.parse_mode(ParseMode::MarkdownV2)
|
||||
.reply_markup(deletion_markup())
|
||||
|
Reference in New Issue
Block a user