Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
veldsla committed Nov 18, 2024
1 parent a2c82f9 commit 17fc89f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
record::{BamRecord, ReadName, RecordError, UmiRecord},
};

#[rustfmt::skip::attributes(clap)]
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
pub struct Config {
Expand Down
13 changes: 8 additions & 5 deletions src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ impl UmiRecord {
pub fn extract_mate_tags(&mut self) -> Result<(), RecordError> {
let data = self.record.data();

let ms_value = data.get(Tag::try_from(*b"ms").unwrap())
.ok_or(RecordError::NoMateScore)?;
let ms = ms_value.value().as_int()
.ok_or(RecordError::MateScoreOutOfRange)
.and_then(|ms| i32::try_from(ms).map_err(|_| RecordError::MateScoreOutOfRange))?;
let ms_value = data
.get(Tag::try_from(*b"ms").unwrap())
.ok_or(RecordError::NoMateScore)?;
let ms = ms_value
.value()
.as_int()
.ok_or(RecordError::MateScoreOutOfRange)
.and_then(|ms| i32::try_from(ms).map_err(|_| RecordError::MateScoreOutOfRange))?;
self.mate_score = Some(ms);

self.mate_cigar = Some(
Expand Down

0 comments on commit 17fc89f

Please sign in to comment.