mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-17 03:26:20 +00:00
listings: remove address_list! macro
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit is contained in:
parent
c751b2e845
commit
7eedd86051
@ -403,25 +403,6 @@ pub struct EntryStrings {
|
||||
pub tags: TagString,
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
/// Creates a comma separated list `String` out of an
|
||||
/// [`Address`](melib::Address) iterable.
|
||||
macro_rules! address_list {
|
||||
(($name:expr) as comma_sep_list) => {{
|
||||
let mut ret: String =
|
||||
$name
|
||||
.into_iter()
|
||||
.fold(String::new(), |mut s: String, n: &melib::Address| {
|
||||
s.extend(n.display().to_string().chars());
|
||||
s.push_str(", ");
|
||||
s
|
||||
});
|
||||
ret.pop();
|
||||
ret.pop();
|
||||
ret
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! digits_of_num {
|
||||
($num:expr) => {{
|
||||
|
@ -1074,7 +1074,7 @@ impl CompactListing {
|
||||
""
|
||||
},
|
||||
)),
|
||||
from: FromString(address_list!((from) as comma_sep_list)),
|
||||
from: FromString(Address::display_name_slice(from)),
|
||||
tags: TagString(tags_string, colors),
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
use std::iter::FromIterator;
|
||||
|
||||
use melib::{SortField, SortOrder, ThreadNode};
|
||||
use melib::{Address, SortField, SortOrder, ThreadNode};
|
||||
|
||||
use super::{EntryStrings, *};
|
||||
use crate::{components::PageMovement, jobs::JoinHandle};
|
||||
@ -783,7 +783,7 @@ impl PlainListing {
|
||||
""
|
||||
},
|
||||
)),
|
||||
from: FromString(address_list!((e.from()) as comma_sep_list)),
|
||||
from: FromString(Address::display_name_slice(e.from())),
|
||||
tags: TagString(tags, colors),
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
use std::{cmp, convert::TryInto, iter::FromIterator};
|
||||
|
||||
use melib::{SortField, SortOrder, ThreadNode, Threads};
|
||||
use melib::{Address, SortField, SortOrder, ThreadNode, Threads};
|
||||
|
||||
use super::*;
|
||||
use crate::{components::PageMovement, jobs::JoinHandle};
|
||||
@ -951,7 +951,7 @@ impl ThreadListing {
|
||||
""
|
||||
},
|
||||
)),
|
||||
from: FromString(address_list!((e.from()) as comma_sep_list)),
|
||||
from: FromString(Address::display_name_slice(e.from())),
|
||||
tags: TagString(tags, colors),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user