Avoiding excessive cloning in Model/ActiveModel
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.9k
- Forks
- 734
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 8
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Model and ActiveModel implementations and the Value type referenced in the issue. Review how String values are represented and cloned in the shown construction pattern, then determine the intended API for reducing repeated cloning. Done should include an agreed implementation and coverage for the repeated-model construction case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100