fix: use saturating_sub in download ETA to prevent underflow (#8410)

This commit is contained in:
jaffar keikei
2026-04-09 10:38:09 -04:00
committed by GitHub
parent 7d6e766027
commit 2471a9e2f8
+1 -1
View File
@@ -251,7 +251,7 @@ impl DownloadManager {
let eta_seconds = if let Some(speed) = speed_bps {
if speed > 0 && total_bytes > 0 {
Some((total_bytes - bytes_downloaded) / speed)
Some(total_bytes.saturating_sub(bytes_downloaded) / speed)
} else {
None
}