Skip to content

Commit

Permalink
bam/record/sequence/subsequence: Implement sam::alignment::record::Se…
Browse files Browse the repository at this point in the history
…quence
  • Loading branch information
zaeleus committed Jul 22, 2024
1 parent e1f305e commit dca4c90
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions noodles-bam/src/record/sequence/subsequence.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use noodles_sam as sam;

use super::{decode_base, Iter};

/// A BAM record subsequence.
Expand Down Expand Up @@ -62,6 +64,24 @@ impl<'a> Subsequence<'a> {
}
}

impl<'a> sam::alignment::record::Sequence for Subsequence<'a> {
fn is_empty(&self) -> bool {
self.is_empty()
}

fn len(&self) -> usize {
self.len()
}

fn get(&self, i: usize) -> Option<u8> {
self.get(i)
}

fn iter(&self) -> Box<dyn Iterator<Item = u8> + '_> {
Box::new(self.iter())
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit dca4c90

Please sign in to comment.