Drop unnecessary mutable reference to self in Seq::mutate
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- bioinformatics
Research direction
Start with the definitions of Seq::mutate and mutate_in_place, then inspect their callers to understand the required receiver change. Done means mutate no longer requires a mutable reference while preserving copy-on-modify behavior and the existing Result semantics.
Written by the indexing model from the issue text.
Description
Problem
Our biological sequence mutate api takes a mutable reference to self:
pub fn mutate(&mut self, interval: Interval, new: Option<&Seq<B>>) -> Result<Self> { ... }
However, inkeeping with the design philosophy of this crate (All sequence operations should be copy-on-modify unless you opt in to an in-place variant mutate_in_place) the mutate method does NOT modify the original data. Instead it clones the sequence and then calls mutate_in_place on the copy.
This was probably so I could write one implementation that actually performs the mutation (in place) and reuse everywhere so it can stay in sync. But the downside is we take a mutable reference to self despite never changing the original data - making the function signature very deceptive.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from selkamand/seqlib
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in selkamand/seqlib
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100