cara mengimplementasikan sifat salinan untuk struct karat

struct MyStruct;

impl Copy for MyStruct { }

impl Clone for MyStruct {
    fn clone(&self) -> MyStruct {
        *self
    }
}
Coding Wizard