Use VecDeque for tasks and marked cells

Replace `Vec` with `VecDeque` in `BoardState` marked cells,
`DiggingTask` path,
and `MinerUnit` tasks to enable efficient push/pop operations. Remove
the
`Copy` trait from several structs and enums, adjust derives accordingly,
and
use `as_ref` in `Option<Units>` implementations to avoid consuming the
option.
Update cell rendering to clone widgets and adjust
`CellWidget::get_option_unit`
to return a cloned `Option<Units>`. Add necessary `VecDeque` imports.
This commit is contained in:
GarandPLG committed 2026-05-06 20:01:49 +02:00
1 parent 41020708e4
commit b66c1d8e25
7 files changed
+29 -28

No files matched your search

+2 -2
View File
@@ -11,7 +11,7 @@ use ratatui::{
widgets::{Block, BorderType, Borders, Paragraph, Widget},
};
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, PartialEq)]
pub struct CellWidget {
row: usize,
col: usize,
@@ -57,7 +57,7 @@ impl CellWidget {
}
pub fn get_option_unit(&self) -> Option<Units> {
self.unit
self.unit.clone()
}
pub fn set_structure(&mut self, structure: Structures) -> &mut Self {