refactor: set_info_box take &str

This commit is contained in:
Jack Wills
2023-10-18 10:44:49 +00:00
parent 322476f341
commit faeaca0cd1
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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),
+2 -2
View File
@@ -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