gltf-rs / gltf

A crate for loading glTF 2.0
Apache License 2.0
535 stars 124 forks source link

Copy on gltf representing types? #426

Open Firestar99 opened 5 months ago

Firestar99 commented 5 months ago

Is there any particular reason most types representing a gltf type, like Node, Mesh or Primitive, are only clone and not copy? Or may I PR all the copy derives?

If we take Node for example, Copy could be trivially derived, and also does not copy too many bytes as it does not copy the underlying json object:

#[derive(Clone, Debug)]
pub struct Node<'a> {
    document: &'a Document,
    index: usize,
    json: &'a json::scene::Node,
}