1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-01 18:31:46 +00:00

Replace deprecated 'error-chain' with 'thiserror' (#1820)

We can't use #[from] on Error::Msg(String) because String does not implement Error.
(Which it shouldn't; see e.g. https://internals.rust-lang.org/t/impl-error-for-string/8881.)
So we implement From manually for Error::Msg, since our current code was written
in that way for error-chain.
This commit is contained in:
Martin Nordholts
2021-08-26 13:12:21 +02:00
committed by GitHub
parent f1c0fd7343
commit 19c3e82abf
12 changed files with 83 additions and 77 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ impl App {
// Read arguments from bats config file
let mut args = get_args_from_env_var()
.unwrap_or_else(get_args_from_config_file)
.chain_err(|| "Could not parse configuration file")?;
.map_err(|_| "Could not parse configuration file")?;
// Put the zero-th CLI argument (program name) first
args.insert(0, cli_args.next().unwrap());
-3
View File
@@ -1,6 +1,3 @@
// `error_chain!` can recurse deeply
#![recursion_limit = "1024"]
mod app;
mod assets;
mod clap_app;