pub(super) fn transform_types<F: FnMut(&syn::Type) -> TracersResult<syn::Type>>(
    typ: &syn::Type,
    mut f: F,
) -> TracersResult<syn::Type> {
    recurse_tree(&mut |t| f(t), typ)
}
/// In the `tracers` macro implementation there are some cases where, given a `Type` instance, I
/// want to recursively visit all nested types.  For example, consider this type expression:
///
/// ```noexecute
/// Option<Result<Box<&str>>>
/// ```
///
/// `syn` will parse this into a single `syn::Type` struct, covering the whole type expression.
/// But if we dig into it, there will be an `Option`, a `Result`, a `Box`, and a `&str`.  This is
/// actually a pretty simple example, it gets much more complex than that.
///
/// If you want to either traverse all of those types building up some kind of list, or if you want
/// to permute those types, it's not so straightforward.  This method does that, and passes a
/// ref to every instance of `syn::Type` to your closure, expecting your closure to apply some kind
/// of transformation.  Originally I designed this so the closure would take a `&mut syn::Type`
/// however I could not figure out how to make that work with a `FnMut` that is called recursively
/// to the borrow checker's satisfaction.
In the `tracers` macro implementation there are some cases where, given a `Type` instance, I
want to recursively visit all nested types.  For example, consider this type expression.



`syn` will parse this into a single `syn::Type` struct, covering the whole type expression.

If you want to either traverse all of those types building up some kind of list, or if you want
to permute those types, it's not so straightforward.  This method does that, and passes a
ref to every instance of `syn::Type` to your closure, expecting your closure to apply some kind
of transformation.  Originally I designed this so the closure would take a `&mut syn::Type`
however I could not figure out how to make that work with a `FnMut` that is called recursively
to the borrow checker's satisfaction.
In the ` tracers ` macro implementation there are some cases where given a ` Type ` instance I want to recursively visit all nested types . For example consider this type expression . ` syn ` will parse this into a single ` syn :: Type ` struct covering the whole type expression . If you want to either traverse all of those types building up some kind of list or if you want to permute those types it ' s not so straightforward . This method does that and passes a ref to every instance of ` syn :: Type ` to your closure expecting your closure to apply some kind of transformation . Originally I designed this so the closure would take a ` &mut syn :: Type ` however I could not figure out how to make that work with a ` FnMut ` that is called recursively to the borrow checker ' s satisfaction .
pub(super) fn transform_types<F: FnMut(&syn::Type) -> TracersResult<syn::Type>>(
    typ: &syn::Type,
    mut f: F,
) -> TracersResult<syn::Type> {
    recurse_tree(&mut |t| f(t), typ)
}
pub ( super ) fn transform_types < F : FnMut ( & syn :: Type ) -> TracersResult < syn :: Type > > ( typ : & syn :: Type , mut f : F , ) -> TracersResult < syn :: Type > { recurse_tree ( & mut | t | f ( t ) , typ ) }
In the `tracers` macro implementation there are some cases where, given a `Type` instance, I
want to recursively visit all nested types.
In the ` tracers ` macro implementation there are some cases where given a ` Type ` instance I want to recursively visit all nested types .
typ
&syn::Type
f
F
typ
&syn::Type
f
F