Skip to content

Avoiding excessive cloning in Model/ActiveModel #2869

@chungwong

Description

@chungwong

Motivation

struct Model {
   name: String,
}

let name: String = "my_name".to_string();

for _ in 1..n {
   Model {
     //        vvvvvvv how to avoid this cloning?
     name: name.clone()
   }
}

Proposed Solutions

I think we can add extensions like Arc to Value.

Additional Information

Originated from https://discord.com/channels/873880840487206962/1449942314381213727

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