From ee815e5f61b34ada09adc31aefe81ae6f4637aa1 Mon Sep 17 00:00:00 2001 From: StNicolay Date: Tue, 30 May 2023 17:38:11 +0300 Subject: [PATCH] Updated /get_accounts to use a write! macro to concatenate the accounts --- src/handlers/commands/get_accounts.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/handlers/commands/get_accounts.rs b/src/handlers/commands/get_accounts.rs index 12ffef1..bb27924 100644 --- a/src/handlers/commands/get_accounts.rs +++ b/src/handlers/commands/get_accounts.rs @@ -1,6 +1,7 @@ use crate::{entity::prelude::Account, errors::NoUserInfo, handlers::markups::deletion_markup}; use futures::TryStreamExt; use sea_orm::prelude::*; +use std::fmt::Write; use teloxide::{adaptors::Throttle, prelude::*, types::ParseMode}; /// Handles /get_accounts command by sending the list of copyable account names to the user @@ -22,7 +23,7 @@ pub async fn get_accounts( }; account_names .try_for_each(|name| { - result.push_str(&format!("\n`{}`", name)); + write!(result, "\n`{name}`").unwrap(); async { Ok(()) } }) .await?;