summaryrefslogtreecommitdiffstats
path: root/lib/etc/libimaginteraction/src
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-09-04 23:02:45 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-09-04 23:02:45 +0200
commitc115215fa4d4e460b08dd7854a5c711a3e819c80 (patch)
tree23a8be2e09100cefb7ed1577edb07af1b06ab5d6 /lib/etc/libimaginteraction/src
parent13af22ac16717235043de25b67194992c0c3a846 (diff)
parent6d1dab31179eb4414b45d9a94f453833ddc558ce (diff)
Merge branch 'master' into libimagerror/integration
This merge solved a _LOT_ of conflicts and was a rather complicated one, as parts of the conflict-resolution involved rewriting of half the stuff. This merge commit fixes all the things so a `cargo check --all` succeeds, but I did not yet check whether tests run without failure.
Diffstat (limited to 'lib/etc/libimaginteraction/src')
-rw-r--r--lib/etc/libimaginteraction/src/readline.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/etc/libimaginteraction/src/readline.rs b/lib/etc/libimaginteraction/src/readline.rs
index 58275444..7d498ce5 100644
--- a/lib/etc/libimaginteraction/src/readline.rs
+++ b/lib/etc/libimaginteraction/src/readline.rs
@@ -19,7 +19,7 @@
use error::InteractionError as IE;
use error::InteractionErrorKind as IEK;
-use error::MapErrInto;
+use error::ResultExt;
use toml::Value;
@@ -46,36 +46,36 @@ impl Readline {
let histfile = try!(match histfile {
Value::String(s) => PathBuf::from(s),
_ => Err(IE::from_kind(IEK::ConfigTypeError))
- .map_err_into(IEK::ConfigError)
- .map_err_into(IEK::ReadlineError)
+ .chain_err(|| IEK::ConfigError)
+ .chain_err(|| IEK::ReadlineError)
});
let histsize = try!(match histsize {
Value::Integer(i) => i,
_ => Err(IE::from_kind(IEK::ConfigTypeError))
- .map_err_into(IEK::ConfigError)
- .map_err_into(IEK::ReadlineError)
+ .chain_err(|| IEK::ConfigError)
+ .chain_err(|| IEK::ReadlineError)
});
let histigndups = try!(match histigndups {
Value::Boolean(b) => b,
_ => Err(IE::from_kind(IEK::ConfigTypeError))
- .map_err_into(IEK::ConfigError)
- .map_err_into(IEK::ReadlineError)
+ .chain_err(|| IEK::ConfigError)
+ .chain_err(|| IEK::ReadlineError)
});
let histignspace = try!(match histignspace {
Value::Boolean(b) => b,
_ => Err(IE::from_kind(IEK::ConfigTypeError))
- .map_err_into(IEK::ConfigError)
- .map_err_into(IEK::ReadlineError)
+ .chain_err(|| IEK::ConfigError)
+ .chain_err(|| IEK::ReadlineError)
});
let prompt = try!(match prompt {
Value::String(s) => s,
_ => Err(IE::from_kind(IEK::ConfigTypeError))
- .map_err_into(IEK::ConfigError)
- .map_err_into(IEK::ReadlineError)
+ .chain_err(|| IEK::ConfigError)
+ .chain_err(|| IEK::ReadlineError)
});
let config = Config::builder().
@@ -88,10 +88,10 @@ impl Readline {
if !histfile.exists() {
let _ = try!(File::create(histfile.clone())
- .map_err_into(IEK::ReadlineHistoryFileCreationError));
+ .chain_err(|| IEK::ReadlineHistoryFileCreationError));
}
- let _ = try!(editor.load_history(&histfile).map_err_into(ReadlineError));
+ let _ = try!(editor.load_history(&histfile).chain_err(|| ReadlineError));
Ok(Readline {
editor: editor,