added rebuild and Arc insted of Box

This commit is contained in:
2024-11-12 15:59:27 +01:00
parent 994b7d2580
commit e1da609eb1
8 changed files with 154 additions and 78 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ pub fn render_to_frame(
state: crate::State,
width: usize,
frame: &mut Vec<String>,
element: &Box<dyn Element>,
element: &std::sync::Arc<dyn Element>,
) {
let data = element.get_data();
for (i, line) in element.render(state).split('\n').enumerate() {
@@ -130,7 +130,7 @@ pub enum Direction {
}
pub fn closest_component(
components: &[Box<dyn Element>],
components: &[std::sync::Arc<dyn Element>],
current_index: usize,
direction: Direction,
) -> usize {