diff options
| author | Teddy Wing | 2018-11-01 08:41:27 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-11-01 08:41:27 +0100 |
| commit | b8ff29a8b9e613c2430c48d5e38a2dc18944f6a0 (patch) | |
| tree | fbddaf22c04bb1d8e3f1fef05f1ecff96d5ae2f0 | |
| parent | d8c2fa73d72ea1efb5a69f39c208de6edf947737 (diff) | |
| download | dome-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.
| -rw-r--r-- | src/ffi.rs | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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) |
