fix: linting
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user