I run into a problem when need to clone a struct that contains a trait object. Fortunately there is an answer on StackOwerflow that helped me (How to clone a struct storing a boxed trait object? - Stack Overflow). But I still don't understand the code. Could you please explain it to me piece by piece?
Thank you very much!
This says that the structure that implements Animal must also implement Clone. It does not add anything (Clone) for the "Trait Object" data type. (Trait Objects internal are an unsized type so can't implement Clone.)
Nightly has addition of #![feature(dyn_trait)] (can try on play) that makes the case where your using a Trait Object more explicit.