fix: linting

This commit is contained in:
Michel de Graaf
2025-11-19 08:40:41 +01:00
parent bb86e50b4f
commit 9f174c4c5e
9 changed files with 93 additions and 57 deletions
+10 -3
View File
@@ -102,13 +102,17 @@ impl Download {
pub fn is_finished(&self) -> bool {
matches!(
self.status,
DownloadStatus::Completed | DownloadStatus::Failed | DownloadStatus::TimedOut
DownloadStatus::Completed
| DownloadStatus::Failed
| DownloadStatus::TimedOut
)
}
pub fn bytes_downloaded(&self) -> u64 {
match &self.status {
DownloadStatus::InProgress { bytes_downloaded, .. } => *bytes_downloaded,
DownloadStatus::InProgress {
bytes_downloaded, ..
} => *bytes_downloaded,
DownloadStatus::Completed => self.size,
_ => 0,
}
@@ -116,7 +120,10 @@ impl Download {
pub fn speed_bytes_per_sec(&self) -> f64 {
match &self.status {
DownloadStatus::InProgress { speed_bytes_per_sec, .. } => *speed_bytes_per_sec,
DownloadStatus::InProgress {
speed_bytes_per_sec,
..
} => *speed_bytes_per_sec,
_ => 0.0,
}
}