From 6035f1c9058eaae0d3ab98609a3573ff71cfdfb4 Mon Sep 17 00:00:00 2001 From: Scott Haug Date: Mon, 27 Feb 2023 09:58:04 -0800 Subject: [PATCH] fix(link): Do not compile link support if not unix or windows --- src/content/symlink.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/content/symlink.rs b/src/content/symlink.rs index a2ff9a9..ca5edcc 100644 --- a/src/content/symlink.rs +++ b/src/content/symlink.rs @@ -9,6 +9,9 @@ use crate::async_lib::AsyncRead; use crate::content::path; use crate::errors::{IoErrorExt, Result}; +#[cfg(not(any(unix, windows)))] +compile_error!("Symlinking is not supported on this platform."); + fn symlink_file(src: P, dst: Q) -> std::io::Result<()> where P: AsRef, @@ -24,13 +27,6 @@ where use std::os::windows::fs::symlink_file; symlink_file(src, dst) } - #[cfg(not(any(unix, windows)))] - { - Err(std::io::Error::new( - std::io::ErrorKind::Other, - "symlinking is not supported on this platform", - )) - } } fn create_symlink(sri: Integrity, cache: &PathBuf, target: &PathBuf) -> Result {