Skip to content

add an assign default method to Clone #10240

Closed
@thestinger

Description

@thestinger

The following pattern is common:

a = b.clone()

However, it is much more inefficient than it could be for a type like a vector, where the allocation on the LHS can often be reused. I previously proposed a trait for this, but now that default methods work that's unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.I-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions