message: simplify EnvelopeAddress's Debug impl

Just render the address in <> to keep it more compact and readable.
This is most visible in the MAIL FROM and RCPT TO responses
when talking to the smtp server.
This commit is contained in:
Wez Furlong
2026-03-28 10:43:32 +00:00
parent 1d5e722c35
commit 89b5efbb4c
+7 -1
View File
@@ -7,10 +7,16 @@ use mlua::{FromLua, MetaMethod, UserData, UserDataFields, UserDataMethods};
use rfc5321::{EnvelopeAddress as EnvelopeAddress5321, ForwardPath, ReversePath};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Eq)]
#[derive(Clone, PartialEq, Serialize, Deserialize, Eq)]
#[serde(transparent)]
pub struct EnvelopeAddress(EnvelopeAddress5321);
impl std::fmt::Debug for EnvelopeAddress {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(fmt, "<{}>", self.0.to_string())
}
}
#[cfg(feature = "impl")]
impl FromLua for EnvelopeAddress {
fn from_lua(value: mlua::Value, lua: &mlua::Lua) -> mlua::Result<Self> {