web: update implement_email macro to handle repetition

This commit is contained in:
Bill Thiede 2023-11-27 20:33:47 -08:00
parent 3a5ca74d71
commit 7cac81cddb

View File

@ -1002,7 +1002,7 @@ impl<T: Email> Email for &'_ T {
}
macro_rules! implement_email {
( $t:ty ) => {
( $($t:ty),+ ) => {$(
impl Email for $t {
fn name(&self) -> Option<&str> {
self.name.as_deref()
@ -1011,11 +1011,14 @@ macro_rules! implement_email {
self.addr.as_deref()
}
}
};
)+};
}
implement_email!(ShowThreadQueryThreadMessagesTo);
implement_email!(ShowThreadQueryThreadMessagesCc);
implement_email!(ShowThreadQueryThreadMessagesFrom);
implement_email!(
ShowThreadQueryThreadMessagesTo,
ShowThreadQueryThreadMessagesCc,
ShowThreadQueryThreadMessagesFrom
);
fn view_address(email: impl Email) -> Node<Msg> {
span![