Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-993

Collection<T> only implements Clone if T implements Clone

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.1.0
    • Affects Version/s: None
    • Component/s: None

      Due to a limitation in the Clone derive macro, a type that derives Clone will only actually be Clone if all of its fields and generic parameters are Clone. For Collection, this is overly restrictive, since none of its fields actually store any values of the generic parameter. We should manually implement Clone instead of deriving it to relax this requirement.

      See https://stegosaurusdormant.com/understanding-derive-clone/ for more information.

            Assignee:
            andrew.witten@mongodb.com Andrew Witten (Inactive)
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: