Skip to content

Commit

Permalink
refactor(extract): trim read names and read ids
Browse files Browse the repository at this point in the history
  • Loading branch information
cauliyang committed Feb 13, 2024
1 parent 50875fd commit 785c8f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ where
let mut read_names = HashSet::new();

for result in reader.lines() {
let read_name = result.map(|s| s.as_bytes().to_vec())?;
let read_name = result.map(|s| s.trim().as_bytes().to_vec())?;
read_names.insert(read_name);
}

Expand All @@ -61,7 +61,7 @@ fn parse_read_ids(read_ids: &str) -> Result<HashSet<Vec<u8>>> {

read_ids
.split(',')
.map(|id| Ok(id.as_bytes().to_vec())) // Replace with the actual method to create ReadName from &str
.map(|id| Ok(id.trim().as_bytes().to_vec())) // Replace with the actual method to create ReadName from &str
.collect::<Result<HashSet<_>, _>>() // Assuming
}

Expand Down

0 comments on commit 785c8f5

Please sign in to comment.