refactor: set_info_box take &str
This commit is contained in:
@@ -91,7 +91,7 @@ impl InputHandler {
|
|||||||
if execute!(std::io::stdout(), DisableMouseCapture).is_ok() {
|
if execute!(std::io::stdout(), DisableMouseCapture).is_ok() {
|
||||||
self.gui_state
|
self.gui_state
|
||||||
.lock()
|
.lock()
|
||||||
.set_info_box("✖ mouse capture disabled".to_owned());
|
.set_info_box("✖ mouse capture disabled");
|
||||||
} else {
|
} else {
|
||||||
self.app_data.lock().set_error(
|
self.app_data.lock().set_error(
|
||||||
AppError::MouseCapture(false),
|
AppError::MouseCapture(false),
|
||||||
@@ -102,7 +102,7 @@ impl InputHandler {
|
|||||||
} else if Ui::enable_mouse_capture().is_ok() {
|
} else if Ui::enable_mouse_capture().is_ok() {
|
||||||
self.gui_state
|
self.gui_state
|
||||||
.lock()
|
.lock()
|
||||||
.set_info_box("✓ mouse capture enabled".to_owned());
|
.set_info_box("✓ mouse capture enabled");
|
||||||
} else {
|
} else {
|
||||||
self.app_data.lock().set_error(
|
self.app_data.lock().set_error(
|
||||||
AppError::MouseCapture(true),
|
AppError::MouseCapture(true),
|
||||||
|
|||||||
+2
-2
@@ -304,8 +304,8 @@ impl GuiState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Set info box content
|
/// Set info box content
|
||||||
pub fn set_info_box(&mut self, text: String) {
|
pub fn set_info_box(&mut self, text: &str) {
|
||||||
self.info_box_text = Some(text);
|
self.info_box_text = Some(text.to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Remove info box content
|
/// Remove info box content
|
||||||
|
|||||||
Reference in New Issue
Block a user