fn replace_entity_type(ty: &mut Type) {
    match ty {
        Type::Array(ty) => replace_entity_type(&mut *ty.elem),
        Type::Tuple(ty) => {
            for ty in ty.elems.iter_mut() {
                replace_entity_type(&mut *ty);
            }
        }
        Type::Paren(ty) => replace_entity_type(&mut *ty.elem),
        Type::Path(ty) => {
            let ty_tok = ty.clone();
            *ty = parse_quote!(<#ty_tok as ConvertSaveload<MA>>::Data);
        }
        Type::Group(ty) => replace_entity_type(&mut *ty.elem),
        Type::TraitObject(_) => {}
        Type::ImplTrait(_) => {}
        Type::Slice(_) => {
            panic!("Slices are unsupported, use owned types like Vecs or Arrays instead")
        }
        Type::Reference(_) => panic!("References are unsupported"),
        Type::Ptr(_) => panic!("Raw pointer types are unsupported"),
        Type::BareFn(_) => panic!("Function types are unsupported"),
        Type::Never(_) => panic!("Never type is unsupported"),
        /* We're in a struct so it doesn't matter */
        Type::Infer(_) => unreachable!(),
        Type::Macro(_) => unreachable!(),
        Type::Verbatim(_) => unimplemented!(),
        _ => unimplemented!(),
    }
}
/// Replaces the type with its corresponding `Data` type.
Replaces the type with its corresponding `Data` type.
Replaces the type with its corresponding ` Data ` type .
fn replace_entity_type(ty: &mut Type) {
    match ty {
        Type::Array(ty) => replace_entity_type(&mut *ty.elem),
        Type::Tuple(ty) => {
            for ty in ty.elems.iter_mut() {
                replace_entity_type(&mut *ty);
            }
        }
        Type::Paren(ty) => replace_entity_type(&mut *ty.elem),
        Type::Path(ty) => {
            let ty_tok = ty.clone();
            *ty = parse_quote!(<#ty_tok as ConvertSaveload<MA>>::Data);
        }
        Type::Group(ty) => replace_entity_type(&mut *ty.elem),
        Type::TraitObject(_) => {}
        Type::ImplTrait(_) => {}
        Type::Slice(_) => {
            panic!("Slices are unsupported, use owned types like Vecs or Arrays instead")
        }
        Type::Reference(_) => panic!("References are unsupported"),
        Type::Ptr(_) => panic!("Raw pointer types are unsupported"),
        Type::BareFn(_) => panic!("Function types are unsupported"),
        Type::Never(_) => panic!("Never type is unsupported"),
        /* We're in a struct so it doesn't matter */
        Type::Infer(_) => unreachable!(),
        Type::Macro(_) => unreachable!(),
        Type::Verbatim(_) => unimplemented!(),
        _ => unimplemented!(),
    }
}
fn replace_entity_type ( ty : & mut Type ) { match ty { Type :: Array ( ty ) => replace_entity_type ( & mut * ty . elem ) , Type :: Tuple ( ty ) => { for ty in ty . elems . iter_mut ( ) { replace_entity_type ( & mut * ty ) ; } } Type :: Paren ( ty ) => replace_entity_type ( & mut * ty . elem ) , Type :: Path ( ty ) => { let ty_tok = ty . clone ( ) ; * ty = parse_quote ! ( ty_tok as ConvertSaveload MA Data ) ; } Type :: Group ( ty ) => replace_entity_type ( & mut * ty . elem ) , Type :: TraitObject ( _ ) => { } Type :: ImplTrait ( _ ) => { } Type :: Slice ( _ ) => { panic ! ( " " ) } Type :: Reference ( _ ) => panic ! ( " " ) , Type :: Ptr ( _ ) => panic ! ( " " ) , Type :: BareFn ( _ ) => panic ! ( " " ) , Type :: Never ( _ ) => panic ! ( " " ) , /* We're in a struct so it doesn't matter */ Type :: Infer ( _ ) => unreachable ! ( ) , Type :: Macro ( _ ) => unreachable ! ( ) , Type :: Verbatim ( _ ) => unimplemented ! ( ) , _ => unimplemented ! ( ) , } }
Replaces the type with its corresponding `Data` type.
Replaces the type with its corresponding ` Data ` type .
ty
&mut Type