Reduce number of AsRef generics

They result in compilation of duplicate code.
This commit is contained in:
link2xt
2021-12-31 13:57:45 +00:00
parent 4136217249
commit 30cb0cbcfd
14 changed files with 53 additions and 61 deletions

View File

@@ -1101,11 +1101,11 @@ impl MimeMessage {
}
}
pub fn repl_msg_by_error(&mut self, error_msg: impl AsRef<str>) {
pub fn repl_msg_by_error(&mut self, error_msg: &str) {
self.is_system_message = SystemMessage::Unknown;
if let Some(part) = self.parts.first_mut() {
part.typ = Viewtype::Text;
part.msg = format!("[{}]", error_msg.as_ref());
part.msg = format!("[{}]", error_msg);
self.parts.truncate(1);
}
}