From 8542d33af2af94dbfef9a3f332b23500b313248e Mon Sep 17 00:00:00 2001 From: white Date: Fri, 31 Oct 2025 13:01:12 +0300 Subject: [PATCH] create patch for workflow --- rust/remove_os_check.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rust/remove_os_check.patch diff --git a/rust/remove_os_check.patch b/rust/remove_os_check.patch new file mode 100644 index 0000000..b34a2af --- /dev/null +++ b/rust/remove_os_check.patch @@ -0,0 +1,19 @@ +diff --git a/crates/iptables/src/lib.rs b/crates/iptables/src/lib.rs +index 4a4d6dc..e7d15fc 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -92,14 +92,6 @@ pub struct IPTables { + pub is_numeric: bool, + } + +-/// Returns `None` because iptables only works on linux +-#[cfg(not(target_os = "linux"))] +-pub fn new(is_ipv6: bool) -> Result> { +- Err(error_from_str("iptables only works on Linux")) +-} +- +-/// Creates a new `IPTables` Result with the command of 'iptables' if `is_ipv6` is `false`, otherwise the command is 'ip6tables'. +-#[cfg(target_os = "linux")] + pub fn new(is_ipv6: bool) -> Result> { + let cmd = if is_ipv6 { "ip6tables" } else { "iptables" }; +