mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
refactore: use clone_from() (#5451)
`a.clone_from(&b)` is equivalent to `a = b.clone()` in functionality, but can be overridden to reuse the resources of a to avoid unnecessary allocations.
This commit is contained in:
@@ -388,7 +388,7 @@ impl Imap {
|
||||
Ok(session) => {
|
||||
// Store server ID in the context to display in account info.
|
||||
let mut lock = context.server_id.write().await;
|
||||
*lock = session.capabilities.server_id.clone();
|
||||
lock.clone_from(&session.capabilities.server_id);
|
||||
|
||||
self.login_failed_once = false;
|
||||
context.emit_event(EventType::ImapConnected(format!(
|
||||
@@ -420,7 +420,7 @@ impl Imap {
|
||||
drop(lock);
|
||||
|
||||
let mut msg = Message::new(Viewtype::Text);
|
||||
msg.text = message.clone();
|
||||
msg.text.clone_from(&message);
|
||||
if let Err(e) =
|
||||
chat::add_device_msg_with_importance(context, None, Some(&mut msg), true)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user