Repository navigation
refactor(zipper): use RawRecord methods in restore_unconverted_bases_in_raw_record - #286
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
=======================================
Coverage 90.03% 90.03%
=======================================
Files 122 122
Lines 61791 61813 +22
=======================================
+ Hits 55632 55652 +20
- Misses 6159 6161 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 35 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe methylation restore function in 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
…in_raw_record
Swap the bam_fields::* free-function calls + manual &mut Vec<u8> plumbing
for RawRecord's inherent methods. Cosmetic-only: same behavior, same
byte-for-byte output, same 17 tests pass. Function signature tightens
from `record: &mut Vec<u8>` to `rec: &mut RawRecord`, which reads more
clearly at the call site.
Replaces:
- bam_fields::flags(record) -> rec.is_unmapped() / rec.is_reverse()
- bam_fields::ref_id / pos -> rec.ref_id() / rec.pos()
- bam_fields::find_string_tag_in_record -> rec.tags().find_string()
- bam_fields::get_cigar_ops -> rec.cigar_ops_vec()
- bam_fields::reference_length_from_cigar -> rec.reference_length()
- bam_fields::l_seq / seq_offset -> rec.l_seq(); seq_off no longer
needed (get_base/set_base compute
internally)
- bam_fields::get_base / set_base -> rec.get_base() / rec.set_base()
- bam_fields::remove_tag -> rec.tags_editor().remove()
The single caller (restore_unconverted_bases_in_raw_template) bridges
template.raw_records (still Vec<Vec<u8>> in Template) by wrapping each
entry in RawRecord::from via std::mem::take and restoring it with
into_inner.
7a3a042 to
f820ecd
Compare
Summary
Cosmetic refactor of `restore_unconverted_bases_in_raw_record` (added in #274) to use `RawRecord`'s inherent methods instead of `bam_fields::*` free-function calls + `&mut Vec` plumbing. Same behavior, same byte-for-byte output, same 17 tests pass.
Part 1 of 7 in the follow-up series closing #272.
Changes
Signature tightens from `record: &mut Vec` to `rec: &mut RawRecord`, which reads more clearly at the call site. Internal replacements:
The single caller (`restore_unconverted_bases_in_raw_template`) bridges `template.raw_records` (still `Vec<Vec>` in `Template`) by wrapping each entry in `RawRecord::from` via `std::mem::take` and restoring it with `into_inner`.
Test plan
Stack