From 8aa4dea9c44093e6a39c96db33d8447a0974fc46 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Sat, 20 May 2023 23:21:24 +0200 Subject: [PATCH] Fix 'already borrowed: BorrowMutError' --- src/api/channels/messages.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/channels/messages.rs b/src/api/channels/messages.rs index 9c27201..0aaf8d1 100644 --- a/src/api/channels/messages.rs +++ b/src/api/channels/messages.rs @@ -99,14 +99,15 @@ pub mod messages { files: Option>, ) -> Result { let token = self.token().clone(); + let mut belongs_to = self.belongs_to.borrow_mut(); Message::send( - self.belongs_to.borrow_mut().urls.get_api().to_string(), + belongs_to.urls.get_api().to_string(), channel_id, message, files, token, &mut self.limits, - &mut self.belongs_to.borrow_mut().limits, + &mut belongs_to.limits, ) .await }