aboutsummaryrefslogtreecommitdiffstats
path: root/mumctl/src/main.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-12-26 22:39:42 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-03-30 15:25:56 +0200
commit5d9716ec34413533ca47166e6764ca6e37a9fc0a (patch)
tree2786ecd732b18a13ac8397b2e3ee3886f7ade9e4 /mumctl/src/main.rs
parent96ac028918baa1094374e823a2464016f7f20479 (diff)
downloadmum-5d9716ec34413533ca47166e6764ca6e37a9fc0a.tar.gz
mumctl: error_if_err!
Diffstat (limited to 'mumctl/src/main.rs')
-rw-r--r--mumctl/src/main.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs
index a3a1a06..812c97b 100644
--- a/mumctl/src/main.rs
+++ b/mumctl/src/main.rs
@@ -202,11 +202,7 @@ fn process_matches(matches: ArgMatches, config: &mut Config, app: &mut App) -> R
if let Some(matches) = matches.subcommand_matches("connect") {
match_server_connect(matches, &config)?;
} else if let Some(_) = matches.subcommand_matches("disconnect") {
- match send_command(Command::ServerDisconnect) {
- Ok(v) => error_if_err!(v),
- Err(e) => error!("{}", e),
- }
- // error_if_err!(send_command(Command::ServerDisconnect));
+ error_if_err!(send_command(Command::ServerDisconnect)?);
} else if let Some(matches) = matches.subcommand_matches("server") {
if let Some(matches) = matches.subcommand_matches("config") {
match_server_config(matches, config);
@@ -276,13 +272,13 @@ fn process_matches(matches: ArgMatches, config: &mut Config, app: &mut App) -> R
match name {
"audio.input_volume" => {
if let Ok(volume) = value.parse() {
- send_command(Command::InputVolumeSet(volume))?.unwrap(); //TODO error_if_err
+ error_if_err!(send_command(Command::InputVolumeSet(volume))?);
config.audio.input_volume = Some(volume);
}
}
"audio.output_volume" => {
if let Ok(volume) = value.parse() {
- send_command(Command::OutputVolumeSet(volume))?.unwrap(); //TODO error_if_err
+ error_if_err!(send_command(Command::OutputVolumeSet(volume))?);
config.audio.output_volume = Some(volume);
}
}
@@ -291,7 +287,7 @@ fn process_matches(matches: ArgMatches, config: &mut Config, app: &mut App) -> R
}
}
} else if matches.subcommand_matches("config-reload").is_some() {
- send_command(Command::ConfigReload)?.unwrap(); //TODO error_if_err
+ error_if_err!(send_command(Command::ConfigReload)?);
} else if let Some(matches) = matches.subcommand_matches("completions") {
app.gen_completions_to(
"mumctl",