mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 17:52:12 +01:00
Make attrs
in fold_attrs
expect Iterator of Attribute
instead of &[Attribute]
This commit is contained in:
parent
9b7e5957cc
commit
47ad84c17e
1 changed files with 2 additions and 3 deletions
|
@ -7,15 +7,14 @@ use syn::{
|
|||
Attribute, Ident, Lit, Path, Token,
|
||||
};
|
||||
|
||||
pub(crate) fn fold_attrs<A, R>(
|
||||
attrs: &[Attribute],
|
||||
pub(crate) fn fold_attrs<'a, A, R>(
|
||||
attrs: impl Iterator<Item = &'a Attribute>,
|
||||
filter: fn(&Attribute) -> bool,
|
||||
parse: impl Fn(Attr) -> Result<R>,
|
||||
init: A,
|
||||
f: impl Fn(A, R) -> Result<A>,
|
||||
) -> Result<A> {
|
||||
attrs
|
||||
.iter()
|
||||
.filter(|&a| filter(a))
|
||||
.flat_map(|attribute| {
|
||||
// FIXME: don't allocate here
|
||||
|
|
Loading…
Reference in a new issue