mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-07 19:18:57 +00:00
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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user