Skip to content

Commit

Permalink
drop human-panic and make error display a bit cleaner (#30)
Browse files Browse the repository at this point in the history
* drop human panic & switch to anyhow for errors.
  • Loading branch information
pmarks authored Oct 7, 2021
1 parent d1343c7 commit d08bd8f
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 142 deletions.
131 changes: 23 additions & 108 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ resolver = "2"
docopt = "*"
rust-htslib = "0.38"
flate2 = { version = "1.0", features = ["zlib"], default-features = false }
shardio = { git = "https://github.com/10XGenomics/rust-shardio.git" }
shardio = "0.8.1"
bincode = "1"
itertools = ">=0.8.0"
regex = "*"
tempfile = "*"
backtrace = "0.3"

csv = "1.0.0"
serde = "^1.0.7"
serde_derive = "^1"
serde_bytes = "*"
failure = "*"
human-panic = "1"
anyhow = { version = "1.0", features = ["backtrace"] }

[profile.release]
debug = 1
Expand Down
3 changes: 1 addition & 2 deletions src/bx_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use rust_htslib::bam::record::{Aux, Record};
use rust_htslib::bam::Read;
use serde::Deserialize;

use failure::Error;
use failure::ResultExt;
use anyhow::{Context, Error};

#[derive(Deserialize, Ord, PartialOrd, Eq, PartialEq)]
struct BcObs {
Expand Down
5 changes: 2 additions & 3 deletions src/locus.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2020 10x Genomics, Inc. All rights reserved.

use failure::format_err;
use failure::Error;
use anyhow::{anyhow, Error};
use regex::Regex;
use serde::Deserialize;
use std::fmt;
Expand Down Expand Up @@ -33,7 +32,7 @@ impl FromStr for Locus {
let cap = re.captures(s);

if cap.is_none() {
return Err(format_err!("invalid locus string: {}", s));
return Err(anyhow!("invalid locus string: {}", s));
}

let cap = cap.unwrap();
Expand Down
Loading

0 comments on commit d08bd8f

Please sign in to comment.