diff --git a/src/lib/telegram/bot.rs b/src/lib/telegram/bot.rs index 1facae9..af068e7 100644 --- a/src/lib/telegram/bot.rs +++ b/src/lib/telegram/bot.rs @@ -108,11 +108,11 @@ impl Bot for TelegramBot { "Adding the user (id = {}), (name = {}).", user_id, user_name ); - users.insert(user_id, Mutex::new(BotUser::new())); + users.insert(user_id, BotUser::new()); }; let text = msg.get_message(); - let mut user = users.get_mut(&user_id).unwrap().lock().await; + let user = users.get_mut(&user_id).unwrap(); // update the user activity user.set_last_activity(chrono::Utc::now()).await; diff --git a/src/lib/types.rs b/src/lib/types.rs index 0b9adf6..ee85446 100644 --- a/src/lib/types.rs +++ b/src/lib/types.rs @@ -51,7 +51,7 @@ pub enum BotMessages { Message, // Telegram messages } -pub type SharedUsers = Arc>>>; +pub type SharedUsers = Arc>>; pub type CommandHashMap = HashMap>; #[async_trait]