mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-31 16:40:37 +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>,
|
f: impl Fn(A, R) -> Result<A>,
|
||||||
) -> Result<A> {
|
) -> Result<A> {
|
||||||
attrs
|
attrs
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|&a| filter(a))
|
.filter(|&a| filter(a))
|
||||||
.flat_map(|attribute| {
|
.flat_map(|attribute| {
|
||||||
let Some(key) = attribute.path.get_ident().cloned()
|
let Some(key) = attribute.path.get_ident().cloned() else {
|
||||||
else { return vec![Err(compile_error_at("expected an ident", attribute.path.span()))] };
|
return vec![Err(compile_error_at(
|
||||||
|
"expected an ident",
|
||||||
|
attribute.path.span(),
|
||||||
|
))];
|
||||||
|
};
|
||||||
|
|
||||||
match (|input: ParseStream<'_>| Attrs::parse_with_key(input, key))
|
match (|input: ParseStream<'_>| Attrs::parse_with_key(input, key))
|
||||||
.parse(attribute.tokens.clone().into())
|
.parse(attribute.tokens.clone().into())
|
||||||
|
|
Loading…
Reference in a new issue