web: update implement_email macro to handle repetition
This commit is contained in:
parent
3a5ca74d71
commit
7cac81cddb
@ -1002,7 +1002,7 @@ impl<T: Email> Email for &'_ T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! implement_email {
|
macro_rules! implement_email {
|
||||||
( $t:ty ) => {
|
( $($t:ty),+ ) => {$(
|
||||||
impl Email for $t {
|
impl Email for $t {
|
||||||
fn name(&self) -> Option<&str> {
|
fn name(&self) -> Option<&str> {
|
||||||
self.name.as_deref()
|
self.name.as_deref()
|
||||||
@ -1011,11 +1011,14 @@ macro_rules! implement_email {
|
|||||||
self.addr.as_deref()
|
self.addr.as_deref()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
)+};
|
||||||
}
|
}
|
||||||
implement_email!(ShowThreadQueryThreadMessagesTo);
|
|
||||||
implement_email!(ShowThreadQueryThreadMessagesCc);
|
implement_email!(
|
||||||
implement_email!(ShowThreadQueryThreadMessagesFrom);
|
ShowThreadQueryThreadMessagesTo,
|
||||||
|
ShowThreadQueryThreadMessagesCc,
|
||||||
|
ShowThreadQueryThreadMessagesFrom
|
||||||
|
);
|
||||||
|
|
||||||
fn view_address(email: impl Email) -> Node<Msg> {
|
fn view_address(email: impl Email) -> Node<Msg> {
|
||||||
span![
|
span![
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user