ui: Fix old Rust borrowing

This commit is contained in:
Dorota Czaplejewicz
2020-03-02 15:52:35 +00:00
parent b409df15bb
commit b19938da01

View File

@ -195,12 +195,12 @@ impl Manager {
let (id, output_state) = match &self.state.current_output { let (id, output_state) = match &self.state.current_output {
Some((id, state)) => { Some((id, state)) => {
if *id != output.get_id() { return } // Not the current output. if *id != output.get_id() { return } // Not the current output.
else { (id, state) } else { (id.clone(), state.clone()) }
}, },
None => return, // Keyboard isn't on any output. None => return, // Keyboard isn't on any output.
}; };
if let Some(new_output_state) = output.get_state() { if let Some(new_output_state) = output.get_state() {
if new_output_state != *output_state { if new_output_state != output_state {
let new_state = ManagerState { let new_state = ManagerState {
current_output: Some((id.clone(), new_output_state)), current_output: Some((id.clone(), new_output_state)),
..self.state.clone() ..self.state.clone()