web: create implement_email! macro
This commit is contained in:
parent
48466808d3
commit
e0fbb0253e
@ -998,30 +998,21 @@ impl<T: Email> Email for &'_ T {
|
||||
}
|
||||
}
|
||||
|
||||
impl Email for ShowThreadQueryThreadMessagesCc {
|
||||
fn name(&self) -> Option<&str> {
|
||||
self.name.as_deref()
|
||||
}
|
||||
fn addr(&self) -> Option<&str> {
|
||||
self.addr.as_deref()
|
||||
}
|
||||
}
|
||||
impl Email for ShowThreadQueryThreadMessagesFrom {
|
||||
fn name(&self) -> Option<&str> {
|
||||
self.name.as_deref()
|
||||
}
|
||||
fn addr(&self) -> Option<&str> {
|
||||
self.addr.as_deref()
|
||||
}
|
||||
}
|
||||
impl Email for ShowThreadQueryThreadMessagesTo {
|
||||
macro_rules! implement_email {
|
||||
( $t:ty ) => {
|
||||
impl Email for $t {
|
||||
fn name(&self) -> Option<&str> {
|
||||
self.name.as_deref()
|
||||
}
|
||||
fn addr(&self) -> Option<&str> {
|
||||
self.addr.as_deref()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
implement_email!(ShowThreadQueryThreadMessagesTo);
|
||||
implement_email!(ShowThreadQueryThreadMessagesCc);
|
||||
implement_email!(ShowThreadQueryThreadMessagesFrom);
|
||||
|
||||
fn view_address(email: impl Email) -> Node<Msg> {
|
||||
span![
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user