fix: remove Unix file metadata usage (Windows compatibility)

This commit is contained in:
ThetaDev 2025-01-13 04:12:46 +01:00
parent 6a604252b1
commit 5c6d992939
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6

View file

@ -10,7 +10,6 @@ use std::{
cmp::Ordering,
ffi::OsString,
ops::Range,
os::unix::fs::MetadataExt,
path::{Path, PathBuf},
sync::Arc,
time::Duration,
@ -1269,7 +1268,7 @@ async fn download_single_file(
if let Err(e) = res {
// Remove temporary file if nothing was downloaded (e.g. 403 error)
if std::fs::metadata(&output_path_tmp)
.map(|md| md.size() == 0)
.map(|md| md.len() == 0)
.unwrap_or_default()
{
_ = std::fs::remove_file(&output_path_tmp);