From cd89d5f60872cf76dab6242575fc4dce9358005c Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 7 Jul 2017 01:00:17 +0200 Subject: [PATCH] Blubb --- src/app_state.rs | 3 +-- src/prefs.rs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app_state.rs b/src/app_state.rs index b41f375bf..3fb7c43d3 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -248,8 +248,7 @@ impl PrefsDialog { let behavior_prefs = BehaviorPrefs { vol_control_cmd, vol_scroll_step: self.scroll_step_spin.get_value(), - middle_click_action: From::from(self.middle_click_combo - .get_active()), + middle_click_action: self.middle_click_combo.get_active().into(), custom_command, }; diff --git a/src/prefs.rs b/src/prefs.rs index 2f4ef484b..13d81940c 100644 --- a/src/prefs.rs +++ b/src/prefs.rs @@ -39,15 +39,15 @@ impl From for MiddleClickAction { 1 => MiddleClickAction::ShowPreferences, 2 => MiddleClickAction::VolumeControl, 3 => MiddleClickAction::CustomCommand, - _ => Default::default(), + _ => MiddleClickAction::ToggleMute, } } } -impl Into for MiddleClickAction { - fn into(self) -> i32 { - match self { +impl From for i32 { + fn from(action: MiddleClickAction) -> Self { + match action { MiddleClickAction::ToggleMute => 0, MiddleClickAction::ShowPreferences => 1, MiddleClickAction::VolumeControl => 2,