Skip to content

Remove Clone bound from more things #72

@jplatte

Description

@jplatte

As a follow-up to #71, I would like to remove the Clone bound from Deserialize too. However, this requires a lot of other changes, so I'd like to discuss it here first.

The solution I'm thinking of is to duplicate a large part of the current API internally to be able to add items to a container while knowing that no Clone is actually called (there might be an alternative around a #[repr(transparent)] wrapper that implements Clone for anything and always panics, but then it's really hard to ensure that that impl is never used). That is, use something like UniqueArc and build UniqueVector, UniqueRRB, UniqueNode and such on top of it. Then FromIterator can use that to drop its Clone bound, and Deserialize doesn't need the Clone bound either anymore.

Wdyt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions