diff options
| author | Teddy Wing | 2018-10-29 00:56:11 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-10-29 00:56:11 +0100 |
| commit | b869d8958b7755be84a242a3e8dc6cfdd197e1b7 (patch) | |
| tree | 0b2128054b499f23f77aebe4f2afaf5066d0b9b9 | |
| parent | b0c0746c0b1449d0793630376493d9fad1b6f2bd (diff) | |
| download | dome-key-map-b869d8958b7755be84a242a3e8dc6cfdd197e1b7.tar.bz2 | |
map::run_key_action(): Remove `unwrap`s when playing sounds
Log errors to stderr logger.
| -rw-r--r-- | src/map.rs | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -38,7 +38,10 @@ pub fn run_key_action<'a>( state.in_mode = None; if play_audio.yes() { - sounds::play_mode_deactivated().unwrap(); + match sounds::play_mode_deactivated() { + Ok(_) => (), + Err(e) => error!("{}", e), + } } return; @@ -60,7 +63,10 @@ pub fn run_key_action<'a>( state.in_mode = Some(trigger.to_vec()); if play_audio.yes() { - sounds::play_mode_activated().unwrap(); + match sounds::play_mode_activated() { + Ok(_) => (), + Err(e) => error!("{}", e), + } } } }, |
