How do I copy/clone a struct that derives neither?
问题 I'm trying to do some game programming with Piston, but i'm struggling with opengl_graphics::Texture , since it does not derive Copy or Clone . extern crate piston_window; extern crate piston; extern crate graphics; extern crate opengl_graphics; use opengl_graphics::Texture as Tex; use piston_window::*; use std::path::Path; use opengl_graphics::GlGraphics; #[derive(PartialEq)] enum ObjectType { Blocking, Passing, } struct Object { sprite: Tex, obj_type: ObjectType, position: Position, }