Repository navigation
fix(sam): use safe conversions for CIGAR ref span and revcomp string - #158
Conversation
Use usize::try_from() instead of bare `as usize` cast for the CIGAR-derived reference span to avoid silent wrapping on negative values. Replace String::from_utf8().expect() with from_utf8_lossy() in revcomp_buf_value to match reverse_buf_value pattern and prevent potential panics on non-ASCII input.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo functions received defensive improvements. 🚥 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)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
==========================================
- Coverage 83.81% 83.81% -0.01%
==========================================
Files 126 126
Lines 51211 51211
==========================================
- Hits 42924 42923 -1
- Misses 8287 8288 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
usize::try_from()instead ofas usizecast for CIGAR-derived reference span inregenerate_alignment_tags_rawto avoid silent wrapping on negative valuesString::from_utf8().expect()withfrom_utf8_lossy()inrevcomp_buf_valueto matchreverse_buf_valuepattern and prevent potential panics# Panicsdoc section fromrevcomp_buf_valueFollow-up to #147 addressing CodeRabbitAI review feedback.
Test plan
cargo ci-test)cargo ci-fmt)cargo ci-lint)