From c8379816a9c8a5278d8bfe0ca435176da2ba0405 Mon Sep 17 00:00:00 2001 From: noamteyssier <22600644+noamteyssier@users.noreply.github.com> Date: Thu, 25 Jun 2026 19:02:55 -0700 Subject: [PATCH 1/2] chore: make binseq input a path --- src/parallel.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/parallel.rs b/src/parallel.rs index 385e6eb..901bbf7 100644 --- a/src/parallel.rs +++ b/src/parallel.rs @@ -10,25 +10,30 @@ use crate::{ /// An enum abstraction for BINSEQ readers that can process records in parallel /// /// This is a convenience enum that can be used for general workflows where the -/// distinction between BQ and VBQ readers is not important. +/// distinction between BINSEQ readers is not important. /// -/// For more specialized workflows see [`bq::MmapReader`] and [`vbq::MmapReader`]. +/// For more specialized workflows see [`bq::MmapReader`], [`vbq::MmapReader`], and [`cbq::MmapReader`]. pub enum BinseqReader { Bq(bq::MmapReader), Vbq(vbq::MmapReader), Cbq(cbq::MmapReader), } impl BinseqReader { - pub fn new(path: &str) -> Result { - let pathbuf = Path::new(path); - match pathbuf.extension() { + pub fn new>(path: P) -> Result { + match path.as_ref().extension() { Some(ext) => match ext.to_str() { Some("bq") => Ok(Self::Bq(bq::MmapReader::new(path)?)), Some("vbq") => Ok(Self::Vbq(vbq::MmapReader::new(path)?)), Some("cbq") => Ok(Self::Cbq(cbq::MmapReader::new(path)?)), - _ => Err(ExtensionError::UnsupportedExtension(path.to_string()).into()), + _ => Err(ExtensionError::UnsupportedExtension( + path.as_ref().to_string_lossy().to_string(), + ) + .into()), }, - None => Err(ExtensionError::UnsupportedExtension(path.to_string()).into()), + None => Err(ExtensionError::UnsupportedExtension( + path.as_ref().to_string_lossy().to_string(), + ) + .into()), } } From e91b55c969edcedb2860dabe513ab702e3ccd2a5 Mon Sep 17 00:00:00 2001 From: noamteyssier <22600644+noamteyssier@users.noreply.github.com> Date: Thu, 25 Jun 2026 19:29:19 -0700 Subject: [PATCH 2/2] chore(semver): bump --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bc1f6a0..8c10bdb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binseq" -version = "0.9.1" +version = "0.9.2" edition = "2024" description = "A high efficiency binary format for sequencing data" license = "MIT"