Refactor: simplify logic and fix edge case

- Replaced redundant conditional checks with a single guard clause
  - Added unit test for edge case handling null input
This commit is contained in:
Eric Coissac
2026-04-19 21:31:16 +02:00
parent 2429131851
commit 41095a40d0
6 changed files with 609 additions and 106 deletions
+2 -2
View File
@@ -34,12 +34,12 @@ fn is_seq_char(c: u8) -> bool {
/// `rope[offset..]` is the remainder for the next chunk.
/// Returns `None` if no valid boundary is found (need more data).
pub fn end_of_last_fastq_entry(rope: &Rope) -> Option<usize> {
let mut cursor = rope.bw_cursor();
let cursor = rope.bw_cursor();
let mut state: u8 = 0;
let mut restart: usize = 0;
let mut cut: usize = rope.len();
while let Some(c) = cursor.next() {
for c in cursor.iter() {
match state {
0 => {
if c == b'+' {