diff options
Diffstat (limited to 'lib/etc/libimaginteraction/src/readline.rs')
-rw-r--r-- | lib/etc/libimaginteraction/src/readline.rs | 26 |
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, |