Skip to content

Would it make sense to introduce a ShallowClone trait with Clone as a subtrait? ShallowClone would be almost like a marker trait and it would provide the method shallow_clone which may call clone by default. If people see that both ShallowClone and Clone is implemented for a type, then they can infer that the type is cheaply cloneable #232

@apoelstra

Description

@apoelstra
          8eeab8f2e6dc61eba299e57b282ecf677a9bce0a: Would it make sense to introduce a `ShallowClone` trait with `Clone` as a subtrait? `ShallowClone` would be almost like a marker trait and it would provide the method `shallow_clone` which may call `clone` by default. If people see that both `ShallowClone` and `Clone` is implemented for a type, then they can infer that the type is cheaply cloneable

Originally posted by @uncomputable in #231 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions