listings: remove address_list! macro

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit is contained in:
Manos Pitsidianakis 2023-12-04 16:29:33 +02:00
parent c751b2e845
commit 7eedd86051
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0
4 changed files with 5 additions and 24 deletions

View File

@ -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) => {{

View File

@ -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),
}
}

View File

@ -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),
}
}

View File

@ -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),
}
}