This commit is contained in:
Paolo Barbolini
2025-07-05 17:37:35 +02:00
parent b752170bd8
commit 4c738085e5

View File

@@ -146,7 +146,7 @@ pub(super) fn dot_atom_text(input: &str) -> IResult<&str, String> {
acc acc
}), }),
), ),
|(dot, chars)| format!("{}{}", dot, chars), |(dot, chars)| format!("{dot}{chars}"),
)), )),
), ),
|(first, rest)| { |(first, rest)| {
@@ -196,7 +196,7 @@ fn quoted_string(input: &str) -> IResult<&str, String> {
acc acc
}, },
), ),
preceded(many0(satisfy(|c| c.is_whitespace())), rfc2234::dquote), preceded(many0(satisfy(char::is_whitespace)), rfc2234::dquote),
), ),
|s| s, |s| s,
) )
@@ -240,13 +240,14 @@ fn display_name(input: &str) -> IResult<&str, String> {
} }
// mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list // mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
#[allow(clippy::type_complexity)]
pub(crate) fn mailbox_list(input: &str) -> IResult<&str, Vec<(Option<String>, (String, String))>> { pub(crate) fn mailbox_list(input: &str) -> IResult<&str, Vec<(Option<String>, (String, String))>> {
terminated( terminated(
separated_list0( separated_list0(
delimited( delimited(
many0(satisfy(|c| c.is_whitespace())), many0(satisfy(char::is_whitespace)),
char(','), char(','),
many0(satisfy(|c| c.is_whitespace())), many0(satisfy(char::is_whitespace)),
), ),
alt((name_addr, map(addr_spec, |addr| (None, addr)))), alt((name_addr, map(addr_spec, |addr| (None, addr)))),
), ),
@@ -302,9 +303,7 @@ pub(super) fn obs_local_part(input: &str) -> IResult<&str, String> {
map( map(
pair( pair(
word, word,
many0(map(pair(char('.'), word), |(dot, w)| { many0(map(pair(char('.'), word), |(dot, w)| format!("{dot}{w}"))),
format!("{}{}", dot, w)
})),
), ),
|(first, rest)| { |(first, rest)| {
let mut result = first; let mut result = first;
@@ -322,9 +321,7 @@ pub(super) fn obs_domain(input: &str) -> IResult<&str, String> {
map( map(
pair( pair(
atom, atom,
many0(map(pair(char('.'), atom), |(dot, a)| { many0(map(pair(char('.'), atom), |(dot, a)| format!("{dot}{a}"))),
format!("{}{}", dot, a)
})),
), ),
|(first, rest)| { |(first, rest)| {
let mut result = first; let mut result = first;