mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-05 10:24:32 +01:00
Make attrs
in fold_attrs
expect iterator of Attribute
instead of iterator of &Attribute
This commit is contained in:
parent
99685f3dcc
commit
e3b5572879
1 changed files with 3 additions and 3 deletions
|
@ -7,15 +7,15 @@ use syn::{
|
||||||
Attribute, Ident, Lit, Path, Token,
|
Attribute, Ident, Lit, Path, Token,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(crate) fn fold_attrs<'a, A, R>(
|
pub(crate) fn fold_attrs<A, R>(
|
||||||
attrs: impl Iterator<Item = &'a Attribute>,
|
attrs: impl Iterator<Item = Attribute>,
|
||||||
filter: fn(&Attribute) -> bool,
|
filter: fn(&Attribute) -> bool,
|
||||||
parse: impl Fn(Attr) -> Result<R>,
|
parse: impl Fn(Attr) -> Result<R>,
|
||||||
init: A,
|
init: A,
|
||||||
f: impl Fn(A, R) -> Result<A>,
|
f: impl Fn(A, R) -> Result<A>,
|
||||||
) -> Result<A> {
|
) -> Result<A> {
|
||||||
attrs
|
attrs
|
||||||
.filter(|&a| filter(a))
|
.filter(filter)
|
||||||
.flat_map(|attribute| {
|
.flat_map(|attribute| {
|
||||||
// FIXME: don't allocate here
|
// FIXME: don't allocate here
|
||||||
let attrs = match attribute.parse_args_with(|input: &ParseBuffer| {
|
let attrs = match attribute.parse_args_with(|input: &ParseBuffer| {
|
||||||
|
|
Loading…
Reference in a new issue