Skip to content

Commit a130133

Browse files
committed
refactor: simplify and explain why n-1
1 parent 139962e commit a130133

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/app.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,12 @@ impl LogViewerApp {
101101
let mut table_builder = TableBuilder::new(ui)
102102
.striped(true)
103103
.resizable(true)
104-
// .stick_to_bottom(self.scroll_to_end_on_load) // Removed because it disabled scroll on move of selected
104+
// .stick_to_bottom(self.scroll_to_end_on_load) // Removed because it disabled scroll on move if selected
105105
.cell_layout(egui::Layout::left_to_right(egui::Align::LEFT));
106106

107+
// Set all columns but the last to auto, last should be remainder which is set after the loop
107108
let n = self.data_display_options.main_list_fields().len();
108-
for _ in self
109-
.data_display_options
110-
.main_list_fields()
111-
.iter()
112-
.take(n - 1)
113-
// TODO 1: Check if this should be just `n` and not `n-1`
114-
{
109+
for _ in 0..n - 1 {
115110
table_builder = table_builder.column(Column::auto());
116111
}
117112
table_builder = table_builder

0 commit comments

Comments
 (0)