diff --git a/rm-main/src/ui/tabs/torrents/mod.rs b/rm-main/src/ui/tabs/torrents/mod.rs index 18cc415..8ef7ba2 100644 --- a/rm-main/src/ui/tabs/torrents/mod.rs +++ b/rm-main/src/ui/tabs/torrents/mod.rs @@ -120,16 +120,17 @@ impl TorrentsTab { .general .accent_color); - let mut table_widget = Table::new(torrent_rows, table_manager_lock.widths) - .highlight_style(highlight_table_style); - - if !self.ctx.config.general.hide_headers { - table_widget = table_widget - .header(Row::new( + let table_widget = { + let table = Table::new(torrent_rows, table_manager_lock.widths) + .highlight_style(highlight_table_style); + if !self.ctx.config.general.hide_headers { + table.header(Row::new( table_manager_lock.header().iter().map(|s| s.as_str()), )) - .clone(); - } + } else { + table + } + }; f.render_stateful_widget( table_widget,