mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 10:26: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:
@@ -80,7 +80,7 @@ impl LoginParam {
|
||||
// Only check for IMAP password, SMTP password is an "advanced" setting.
|
||||
ensure!(!param.imap.password.is_empty(), "Missing (IMAP) password.");
|
||||
if param.smtp.password.is_empty() {
|
||||
param.smtp.password = param.imap.password.clone()
|
||||
param.smtp.password.clone_from(¶m.imap.password)
|
||||
}
|
||||
Ok(param)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user