From cc327fd8c0df2c2dffc48618351b2a0a5a24a9fc Mon Sep 17 00:00:00 2001 From: Joseph Guhlin Date: Mon, 25 Nov 2024 12:11:59 +1300 Subject: [PATCH] Handle dev and local versions better Also improve some error messages --- Cargo.toml | 2 +- src/lib.rs | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c90931a..1feaa74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ libc = "0.2" needletail = { version = "0.6", optional = true, default-features = false} # Dep for development -minimap2-sys = { path = "./minimap2-sys" } +minimap2-sys = { path = "./minimap2-sys", version = "0.1.20+minimap2.2.28" } # minimap2-sys = "0.1.19" rust-htslib = { version = "0.48", default-features = false, optional = true } diff --git a/src/lib.rs b/src/lib.rs index 7bcbb9a..cc0729f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -631,29 +631,27 @@ impl Aligner { { let path_str = match std::ffi::CString::new(path.as_ref().as_os_str().as_bytes()) { Ok(path) => { - // println!("{:#?}", path); path } Err(_) => { - println!("Got error"); - return Err("Invalid Path"); + return Err("Invalid Path for Index"); } }; // Confirm file exists if !path.as_ref().exists() { - return Err("File does not exist"); + return Err("Index File does not exist"); } // Confirm file is not empty if path.as_ref().metadata().unwrap().len() == 0 { - return Err("File is empty"); + return Err("Index File is empty"); } let output = match output { Some(output) => match std::ffi::CString::new(output) { Ok(output) => output, - Err(_) => return Err("Invalid Output"), + Err(_) => return Err("Invalid Output for Index"), }, None => std::ffi::CString::new(Vec::new()).unwrap(), };