From 5c6d992939f55a203ac1784f1e9175ac1d498ce8 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 13 Jan 2025 04:12:46 +0100 Subject: [PATCH] fix: remove Unix file metadata usage (Windows compatibility) --- downloader/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/downloader/src/lib.rs b/downloader/src/lib.rs index 9efccc7..178b934 100644 --- a/downloader/src/lib.rs +++ b/downloader/src/lib.rs @@ -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);