aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2018-11-01 08:41:27 +0100
committerTeddy Wing2018-11-01 08:41:27 +0100
commitb8ff29a8b9e613c2430c48d5e38a2dc18944f6a0 (patch)
treefbddaf22c04bb1d8e3f1fef05f1ecff96d5ae2f0 /src
parentd8c2fa73d72ea1efb5a69f39c208de6edf947737 (diff)
downloaddome-key-map-b8ff29a8b9e613c2430c48d5e38a2dc18944f6a0.tar.bz2
dome_key_state_load_map_group(): Get rid of error chain on parse
Since 'combine' errors aren't included in our error chain, calling `chain_err()` only printed the message inside, not the parser error. The trouble is, we can't add 'combine''s error to 'error-chain' because it needs a lifetime: combine::Easy::Errors<char, &str, SourcePosition> and you can't use errors with lifetimes in 'error-chain'. Since we can't use 'error-chain', just use the 'combine' error directly. This doesn't allow us to chain an addiitional error message, but does correctly print the parse error message.
Diffstat (limited to 'src')
-rw-r--r--src/ffi.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ffi.rs b/src/ffi.rs
index 4738c18..7a9db59 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -72,9 +72,7 @@ pub extern "C" fn dome_key_state_load_map_group(ptr: *mut State) {
},
};
- let map_group = match MapGroup::parse(&state.mappings_str)
- .chain_err(|| "failed to parse 'mappings.dkmap'")
- {
+ let map_group = match MapGroup::parse(&state.mappings_str) {
Ok(mut map_group) => {
map_group.parse_actions();
Some(map_group)