mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +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:
@@ -604,7 +604,7 @@ impl MimeMessage {
|
||||
let mut filepart = self.parts.swap_remove(1);
|
||||
|
||||
// insert new one
|
||||
filepart.msg = self.parts[0].msg.clone();
|
||||
filepart.msg.clone_from(&self.parts[0].msg);
|
||||
if let Some(quote) = self.parts[0].param.get(Param::Quote) {
|
||||
filepart.param.set(Param::Quote, quote);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user