From b8ff29a8b9e613c2430c48d5e38a2dc18944f6a0 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 1 Nov 2018 08:41:27 +0100 Subject: 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 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. --- src/ffi.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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) -- cgit v1.2.3