diff --git a/src/chatlist.rs b/src/chatlist.rs index 138203328..2a9367688 100644 --- a/src/chatlist.rs +++ b/src/chatlist.rs @@ -385,7 +385,7 @@ impl Chatlist { ret.text2 = None; } else if lastmsg.is_none() || lastmsg.as_ref().unwrap().from_id == DC_CONTACT_ID_UNDEFINED { - ret.text2 = Some(stock_str::no_messages(context).await.to_string()); + ret.text2 = Some(stock_str::no_messages(context).await); } else { ret.fill(&mut lastmsg.unwrap(), chat, lastcontact.as_ref(), context) .await; diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index cb597b6a7..506213b79 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -1289,7 +1289,7 @@ async fn create_or_lookup_group( // After all, the sender has a reference/in-reply-to that // points to this chat. let s = stock_str::unknown_sender_for_chat(context).await; - mime_parser.repl_msg_by_error(s.to_string()); + mime_parser.repl_msg_by_error(s); } // check if the group does not exist but should be created @@ -2633,11 +2633,7 @@ mod tests { assert_eq!( last_msg.text, - Some( - stock_str::failed_sending_to(&t, "assidhfaaspocwaeofi@gmail.com") - .await - .to_string(), - ) + Some(stock_str::failed_sending_to(&t, "assidhfaaspocwaeofi@gmail.com").await,) ); assert_eq!(last_msg.from_id, DC_CONTACT_ID_INFO); } diff --git a/src/ephemeral.rs b/src/ephemeral.rs index 585fcdfd2..e582e6476 100644 --- a/src/ephemeral.rs +++ b/src/ephemeral.rs @@ -195,11 +195,7 @@ impl ChatId { } self.inner_set_ephemeral_timer(context, timer).await?; let mut msg = Message::new(Viewtype::Text); - msg.text = Some( - stock_ephemeral_timer_changed(context, timer, DC_CONTACT_ID_SELF) - .await - .to_string(), - ); + msg.text = Some(stock_ephemeral_timer_changed(context, timer, DC_CONTACT_ID_SELF).await); msg.param.set_cmd(SystemMessage::EphemeralTimerChanged); if let Err(err) = send_msg(context, self, &mut msg).await { error!( diff --git a/src/stock_str.rs b/src/stock_str.rs index 1f841ad83..4f5c6e375 100644 --- a/src/stock_str.rs +++ b/src/stock_str.rs @@ -895,7 +895,6 @@ impl Context { ProtectionStatus::Unprotected => protection_enabled(self, from_id).await, ProtectionStatus::Protected => protection_disabled(self, from_id).await, } - .to_string() } pub(crate) async fn update_device_chats(&self) -> Result<(), Error> {