Yeah, you can't pass one type when the function expects another type. You have either use generics and trait bounds or provide the exact type that a function expects..
Barbacamanitu
joined 1 year ago
What errors are you getting when converting from BaseArmy to Army? If you're storing references to other structs in your struct, things can get complicated. Using Clone/Copy types will make things easier.
I'd also recommend the builder pattern for this. It let's you build up a type incrementally, with a final build step that produces the final type.
Yeah, you can't pass one type when the function expects another type. You have either use generics and trait bounds or provide the exact type that a function expects..