pub(crate) fn build_spanned_iter<'a>(
        &mut self,
        back: bool,
        mut it: impl Iterator<Item = (Option<TokenStream>, &'a syn::Field)>,
    ) -> Option<(bool, Option<TokenStream>)> {
        let mut quote = None::<TokenStream>;

        loop {
            let (var, field) = match it.next() {
                Some((var, field)) => (var?, field),
                None => {
                    return Some((true, quote));
                }
            };

            let attrs = self.parse_field_attributes(&field.attrs)?;

            let spanned = &self.spanned;

            if attrs.skip() {
                continue;
            }

            if attrs.optional.is_some() {
                let option_spanned = &self.option_spanned;
                let next = quote_spanned! {
                    field.span() => #option_spanned::option_span(#var)
                };

                if quote.is_some() {
                    quote = Some(quote_spanned! {
                        field.span() => #quote.or_else(|| #next)
                    });
                } else {
                    quote = Some(next);
                }

                continue;
            }

            if attrs.iter.is_some() {
                let next = if back {
                    quote_spanned!(field.span() => next_back)
                } else {
                    quote_spanned!(field.span() => next)
                };

                let spanned = &self.spanned;
                let next = quote_spanned! {
                    field.span() => IntoIterator::into_iter(#var).#next().map(#spanned::span)
                };

                if quote.is_some() {
                    quote = Some(quote_spanned! {
                        field.span() => #quote.or_else(|| #next)
                    });
                } else {
                    quote = Some(next);
                }

                continue;
            }

            if quote.is_some() {
                quote = Some(quote_spanned! {
                    field.span() => #quote.unwrap_or_else(|| #spanned::span(#var))
                });
            } else {
                quote = Some(quote_spanned! {
                    field.span() => #spanned::span(#var)
                });
            }

            return Some((false, quote));
        }
    }
/// Build an inner spanned decoder from an iterator.
Build an inner spanned decoder from an iterator.
Build an inner spanned decoder from an iterator .
pub(crate) fn build_spanned_iter<'a>(
        &mut self,
        back: bool,
        mut it: impl Iterator<Item = (Option<TokenStream>, &'a syn::Field)>,
    ) -> Option<(bool, Option<TokenStream>)> {
        let mut quote = None::<TokenStream>;
        loop {
            let (var, field) = match it.next() {
                Some((var, field)) => (var?, field),
                None => {
                    return Some((true, quote));
                }
            };
            let attrs = self.parse_field_attributes(&field.attrs)?;
            let spanned = &self.spanned;
            if attrs.skip() {
                continue;
            }
            if attrs.optional.is_some() {
                let option_spanned = &self.option_spanned;
                let next = quote_spanned! {
                    field.span() => #option_spanned::option_span(#var)
                };
                if quote.is_some() {
                    quote = Some(quote_spanned! {
                        field.span() => #quote.or_else(|| #next)
                    });
                } else {
                    quote = Some(next);
                }
                continue;
            }
            if attrs.iter.is_some() {
                let next = if back {
                    quote_spanned!(field.span() => next_back)
                } else {
                    quote_spanned!(field.span() => next)
                };
                let spanned = &self.spanned;
                let next = quote_spanned! {
                    field.span() => IntoIterator::into_iter(#var).#next().map(#spanned::span)
                };
                if quote.is_some() {
                    quote = Some(quote_spanned! {
                        field.span() => #quote.or_else(|| #next)
                    });
                } else {
                    quote = Some(next);
                }
                continue;
            }
            if quote.is_some() {
                quote = Some(quote_spanned! {
                    field.span() => #quote.unwrap_or_else(|| #spanned::span(#var))
                });
            } else {
                quote = Some(quote_spanned! {
                    field.span() => #spanned::span(#var)
                });
            }
            return Some((false, quote));
        }
    }
pub ( crate ) fn build_spanned_iter < ' a > ( & mut self , back : bool , mut it : impl Iterator < Item = ( Option < TokenStream > , & ' a syn :: Field ) > , ) -> Option < ( bool , Option < TokenStream > ) > { let mut quote = None :: < TokenStream > ; loop { let ( var , field ) = match it . next ( ) { Some ( ( var , field ) ) => ( var ? , field ) , None => { return Some ( ( true , quote ) ) ; } } ; let attrs = self . parse_field_attributes ( & field . attrs ) ? ; let spanned = & self . spanned ; if attrs . skip ( ) { continue ; } if attrs . optional . is_some ( ) { let option_spanned = & self . option_spanned ; let next = quote_spanned ! { field span ( ) option_spanned option_span ( var ) } ; if quote . is_some ( ) { quote = Some ( quote_spanned ! { field span ( ) quote or_else ( next ) } ) ; } else { quote = Some ( next ) ; } continue ; } if attrs . iter . is_some ( ) { let next = if back { quote_spanned ! ( field span ( ) next_back ) } else { quote_spanned ! ( field span ( ) next ) } ; let spanned = & self . spanned ; let next = quote_spanned ! { field span ( ) IntoIterator into_iter ( var ) next ( ) map ( spanned span ) } ; if quote . is_some ( ) { quote = Some ( quote_spanned ! { field span ( ) quote or_else ( next ) } ) ; } else { quote = Some ( next ) ; } continue ; } if quote . is_some ( ) { quote = Some ( quote_spanned ! { field span ( ) quote unwrap_or_else ( spanned span ( var ) ) } ) ; } else { quote = Some ( quote_spanned ! { field span ( ) spanned span ( var ) } ) ; } return Some ( ( false , quote ) ) ; } }
Build an inner spanned decoder from an iterator.
Build an inner spanned decoder from an iterator .
&mut self
back
bool
it
impl Iterator<Item = (Option<TokenStream>, &'a syn::Field)>
&mut self
back
bool
it
impl Iterator<Item = (Option<TokenStream>, &'a syn::Field)>