fn recurse_path<F: FnMut(&syn::Type) -> TracersResult<syn::Type>>(
    f: &mut F,
    path: &syn::Path,
) -> TracersResult<syn::Path> {
    let mut path = path.clone();
    for seg in path.segments.iter_mut() {
        match seg.arguments {
            syn::PathArguments::None => {}
            syn::PathArguments::AngleBracketed(ref mut args) => {
                for arg in args.args.iter_mut() {
                    if let syn::GenericArgument::Type(ref mut typ) = arg {
                        *typ = recurse_tree(f, typ)?;
                    }
                }
            }
            syn::PathArguments::Parenthesized(ref mut args) => {
                if let syn::ReturnType::Type(_, ref mut typ) = args.output {
                    *typ = Box::new(recurse_tree(f, &typ)?)
                }

                for arg in args.inputs.iter_mut() {
                    *arg = recurse_tree(f, arg)?;
                }
            }
        }
    }

    Ok(path)
}
/// `Path` is something of a special case that is complex enough to require its own
/// function and which appears in multiple places.
`Path` is something of a special case that is complex enough to require its own
function and which appears in multiple places.
` Path ` is something of a special case that is complex enough to require its own function and which appears in multiple places .
fn recurse_path<F: FnMut(&syn::Type) -> TracersResult<syn::Type>>(
    f: &mut F,
    path: &syn::Path,
) -> TracersResult<syn::Path> {
    let mut path = path.clone();
    for seg in path.segments.iter_mut() {
        match seg.arguments {
            syn::PathArguments::None => {}
            syn::PathArguments::AngleBracketed(ref mut args) => {
                for arg in args.args.iter_mut() {
                    if let syn::GenericArgument::Type(ref mut typ) = arg {
                        *typ = recurse_tree(f, typ)?;
                    }
                }
            }
            syn::PathArguments::Parenthesized(ref mut args) => {
                if let syn::ReturnType::Type(_, ref mut typ) = args.output {
                    *typ = Box::new(recurse_tree(f, &typ)?)
                }
                for arg in args.inputs.iter_mut() {
                    *arg = recurse_tree(f, arg)?;
                }
            }
        }
    }
    Ok(path)
}
fn recurse_path < F : FnMut ( & syn :: Type ) -> TracersResult < syn :: Type > > ( f : & mut F , path : & syn :: Path , ) -> TracersResult < syn :: Path > { let mut path = path . clone ( ) ; for seg in path . segments . iter_mut ( ) { match seg . arguments { syn :: PathArguments :: None => { } syn :: PathArguments :: AngleBracketed ( ref mut args ) => { for arg in args . args . iter_mut ( ) { if let syn :: GenericArgument :: Type ( ref mut typ ) = arg { * typ = recurse_tree ( f , typ ) ? ; } } } syn :: PathArguments :: Parenthesized ( ref mut args ) => { if let syn :: ReturnType :: Type ( _ , ref mut typ ) = args . output { * typ = Box :: new ( recurse_tree ( f , & typ ) ? ) } for arg in args . inputs . iter_mut ( ) { * arg = recurse_tree ( f , arg ) ? ; } } } } Ok ( path ) }
`Path` is something of a special case that is complex enough to require its own
function and which appears in multiple places.
` Path ` is something of a special case that is complex enough to require its own function and which appears in multiple places .
f
&mut F
path
&syn::Path
f
&mut F
path
&syn::Path