From 139c0359bc3b16f4ff9ef8de51783ef5874309ee Mon Sep 17 00:00:00 2001 From: Juha Kukkonen Date: Tue, 21 May 2024 21:23:52 +0300 Subject: [PATCH] Add missing windows check to utoipa-swagger-ui build.rs --- utoipa-swagger-ui/build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utoipa-swagger-ui/build.rs b/utoipa-swagger-ui/build.rs index 75d5fbde..742a329e 100644 --- a/utoipa-swagger-ui/build.rs +++ b/utoipa-swagger-ui/build.rs @@ -175,7 +175,11 @@ struct SwaggerUiDist; fn download_file(url: &str, path: PathBuf) -> Result<(), Box> { let reqwest_feature = env::var("CARGO_FEATURE_REQWEST"); println!("reqwest feature: {reqwest_feature:?}"); - if reqwest_feature.is_ok() { + if reqwest_feature.is_ok() + || env::var("CARGO_CFG_TARGET_OS") + .map(|os| os == "windows") + .unwrap_or_default() + { #[cfg(any(feature = "reqwest", target_os = "windows"))] { download_file_reqwest(url, path)?;