Skip to content

Commit

Permalink
fix minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
micielski committed Jul 5, 2024
1 parent 68818fe commit 1e6b8b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rm-config/defaults/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[General]
[general]
# Whether to hide empty columns or not
auto_hide = false

Expand Down
21 changes: 10 additions & 11 deletions rm-main/src/ui/tabs/torrents/rustmission_torrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@ impl RustmissionTorrent {
pub fn to_row(&self, headers: &Vec<Header>) -> ratatui::widgets::Row {
let mut cells = vec![];
for header in headers {
match header {
Header::Name => cells.push(Line::from(self.torrent_name.as_str())),
Header::SizeWhenDone => cells.push(Line::from(self.size_when_done.as_str())),
Header::Progress => cells.push(Line::from(self.progress.as_str())),
Header::Eta => cells.push(Line::from(self.eta_secs.as_str())),
Header::DownloadRate => {
cells.push(Line::from(download_speed_format(&self.download_speed)))
let cell = {
match header {
Header::Name => Line::from(self.torrent_name.as_str()),
Header::SizeWhenDone => Line::from(self.size_when_done.as_str()),
Header::Progress => Line::from(self.progress.as_str()),
Header::Eta => Line::from(self.eta_secs.as_str()),
Header::DownloadRate => Line::from(download_speed_format(&self.download_speed)),
Header::UploadRate => Line::from(upload_speed_format(&self.upload_speed)),
Header::DownloadDir => Line::from(self.download_dir.as_str()),
}
Header::UploadRate => {
cells.push(Line::from(upload_speed_format(&self.upload_speed)))
}
Header::DownloadDir => cells.push(Line::from(self.download_dir.as_str())),
};
cells.push(cell);
}

Row::new(cells).style(self.style)
Expand Down

0 comments on commit 1e6b8b7

Please sign in to comment.