From a61b91580858fdf389d60056afdf4daefda1d734 Mon Sep 17 00:00:00 2001 From: Xuz Date: Fri, 25 Sep 2026 14:19:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E5=9C=A8=20Unix=20=E4=B8=8A=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E4=BB=85=E4=BE=9B=20Unix=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=20SFTP=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BE=85=E5=8A=A9=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit local_test_server 和 batch_to 只被 cfg(unix) 的测试调用,在 Windows 上 成了死代码,让 clippy -D warnings 失败。 Co-Authored-By: Claude --- src/sftp/client.rs | 3 ++- src/sftp/tests.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sftp/client.rs b/src/sftp/client.rs index 9f9acfe..38e7f07 100644 --- a/src/sftp/client.rs +++ b/src/sftp/client.rs @@ -94,7 +94,8 @@ impl SftpClient { fsync, }) } - #[cfg(test)] + /// Only the Unix tests have a local `sftp-server` to talk to. + #[cfg(all(test, unix))] pub(super) async fn local_test_server( directory: &std::path::Path, ) -> Result<(Self, tokio::process::Child)> { diff --git a/src/sftp/tests.rs b/src/sftp/tests.rs index 130b905..ea1e95a 100644 --- a/src/sftp/tests.rs +++ b/src/sftp/tests.rs @@ -1590,6 +1590,7 @@ fn an_scp_upload_takes_the_destination_name_and_keeps_the_execute_bits() { }); } +#[cfg(unix)] async fn batch_to( source: &Path, destination: &str,