diff --git a/noodles-sam/src/lazy/record/quality_scores.rs b/noodles-sam/src/lazy/record/quality_scores.rs index 7d4e42b35..2489c8c06 100644 --- a/noodles-sam/src/lazy/record/quality_scores.rs +++ b/noodles-sam/src/lazy/record/quality_scores.rs @@ -18,6 +18,21 @@ impl<'a> QualityScores<'a> { } } +impl<'a> crate::alignment::record::QualityScores for QualityScores<'a> { + fn is_empty(&self) -> bool { + self.is_empty() + } + + fn len(&self) -> usize { + self.len() + } + + fn iter(&self) -> Box + '_> { + const OFFSET: u8 = b'!'; + Box::new(self.as_ref().iter().map(|&b| b - OFFSET)) + } +} + impl<'a> AsRef<[u8]> for QualityScores<'a> { fn as_ref(&self) -> &[u8] { self.0