fn replace_self(tref: &mut syn::TypeReference, self_path: &syn::Path) {
    match &mut *tref.elem {
        syn::Type::Reference(tref_inner) => replace_self(tref_inner, self_path),
        syn::Type::Path(tpath) => {
            if let Some(ident) = tpath.path.get_ident() {
                if ident == "Self" {
                    tpath.path = self_path.to_owned();
                }
            }
        }
        _ => {}
    }
}
/// Replace `Self` with the exact type name since it is used out of the impl block
Replace `Self` with the exact type name since it is used out of the impl block
Replace ` Self ` with the exact type name since it is used out of the impl block
fn replace_self(tref: &mut syn::TypeReference, self_path: &syn::Path) {
    match &mut *tref.elem {
        syn::Type::Reference(tref_inner) => replace_self(tref_inner, self_path),
        syn::Type::Path(tpath) => {
            if let Some(ident) = tpath.path.get_ident() {
                if ident == "Self" {
                    tpath.path = self_path.to_owned();
                }
            }
        }
        _ => {}
    }
}
fn replace_self ( tref : & mut syn :: TypeReference , self_path : & syn :: Path ) { match & mut * tref . elem { syn :: Type :: Reference ( tref_inner ) => replace_self ( tref_inner , self_path ) , syn :: Type :: Path ( tpath ) => { if let Some ( ident ) = tpath . path . get_ident ( ) { if ident == " " { tpath . path = self_path . to_owned ( ) ; } } } _ => { } } }
Replace `Self` with the exact type name since it is used out of the impl block
Replace ` Self ` with the exact type name since it is used out of the impl block
tref
&mut syn::TypeReference
self_path
&syn::Path