mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Fix fold_attrs
format
This commit is contained in:
parent
7c7f58dffb
commit
f979cc4f26
1 changed files with 8 additions and 4 deletions
|
@ -15,11 +15,15 @@ pub(crate) fn fold_attrs<A, R>(
|
|||
f: impl Fn(A, R) -> Result<A>,
|
||||
) -> Result<A> {
|
||||
attrs
|
||||
.iter()
|
||||
.filter(|&a| filter(a))
|
||||
.iter()
|
||||
.filter(|&a| filter(a))
|
||||
.flat_map(|attribute| {
|
||||
let Some(key) = attribute.path.get_ident().cloned()
|
||||
else { return vec![Err(compile_error_at("expected an ident", attribute.path.span()))] };
|
||||
let Some(key) = attribute.path.get_ident().cloned() else {
|
||||
return vec![Err(compile_error_at(
|
||||
"expected an ident",
|
||||
attribute.path.span(),
|
||||
))];
|
||||
};
|
||||
|
||||
match (|input: ParseStream<'_>| Attrs::parse_with_key(input, key))
|
||||
.parse(attribute.tokens.clone().into())
|
||||
|
|
Loading…
Reference in a new issue