diff --git a/src/input_handler/mod.rs b/src/input_handler/mod.rs index 4341e86..c05164c 100644 --- a/src/input_handler/mod.rs +++ b/src/input_handler/mod.rs @@ -91,7 +91,7 @@ impl InputHandler { if execute!(std::io::stdout(), DisableMouseCapture).is_ok() { self.gui_state .lock() - .set_info_box("✖ mouse capture disabled".to_owned()); + .set_info_box("✖ mouse capture disabled"); } else { self.app_data.lock().set_error( AppError::MouseCapture(false), @@ -102,7 +102,7 @@ impl InputHandler { } else if Ui::enable_mouse_capture().is_ok() { self.gui_state .lock() - .set_info_box("✓ mouse capture enabled".to_owned()); + .set_info_box("✓ mouse capture enabled"); } else { self.app_data.lock().set_error( AppError::MouseCapture(true), diff --git a/src/ui/gui_state.rs b/src/ui/gui_state.rs index a08f3cc..18e92f5 100644 --- a/src/ui/gui_state.rs +++ b/src/ui/gui_state.rs @@ -304,8 +304,8 @@ impl GuiState { } /// Set info box content - pub fn set_info_box(&mut self, text: String) { - self.info_box_text = Some(text); + pub fn set_info_box(&mut self, text: &str) { + self.info_box_text = Some(text.to_owned()); } /// Remove info box content