From d576a90fc71b576148390edd3ffd1b623a5e78b5 Mon Sep 17 00:00:00 2001 From: Thibaut Vandervelden Date: Mon, 16 Sep 2024 11:57:12 +0200 Subject: [PATCH] examples: allow dead code for other than Linux --- examples/benchmark.rs | 2 ++ examples/client.rs | 2 ++ examples/dhcp_client.rs | 2 ++ examples/dns.rs | 2 ++ examples/httpclient.rs | 2 ++ examples/multicast.rs | 2 ++ examples/multicast6.rs | 2 ++ examples/ping.rs | 2 ++ examples/server.rs | 2 ++ 9 files changed, 18 insertions(+) diff --git a/examples/benchmark.rs b/examples/benchmark.rs index 9e59a50dd..5d44aea69 100644 --- a/examples/benchmark.rs +++ b/examples/benchmark.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use std::cmp; diff --git a/examples/client.rs b/examples/client.rs index 9cb8814cd..710f1fdfa 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use log::debug; diff --git a/examples/dhcp_client.rs b/examples/dhcp_client.rs index d79f8bc03..435b0a090 100644 --- a/examples/dhcp_client.rs +++ b/examples/dhcp_client.rs @@ -1,4 +1,6 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] #![allow(clippy::option_map_unit_fn)] + mod utils; use log::*; diff --git a/examples/dns.rs b/examples/dns.rs index 8468a43ca..3b32c5066 100644 --- a/examples/dns.rs +++ b/examples/dns.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use smoltcp::iface::{Config, Interface, SocketSet}; diff --git a/examples/httpclient.rs b/examples/httpclient.rs index 7e3798e50..6cde59e39 100644 --- a/examples/httpclient.rs +++ b/examples/httpclient.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use log::debug; diff --git a/examples/multicast.rs b/examples/multicast.rs index 382021398..19ba3023b 100644 --- a/examples/multicast.rs +++ b/examples/multicast.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use std::os::unix::io::AsRawFd; diff --git a/examples/multicast6.rs b/examples/multicast6.rs index d0377d2a1..d7f0f10d8 100644 --- a/examples/multicast6.rs +++ b/examples/multicast6.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use std::os::unix::io::AsRawFd; diff --git a/examples/ping.rs b/examples/ping.rs index 5505b5e33..c0db5d3a1 100644 --- a/examples/ping.rs +++ b/examples/ping.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use byteorder::{ByteOrder, NetworkEndian}; diff --git a/examples/server.rs b/examples/server.rs index 5f303a97c..0bc395db1 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(any(target_os = "linux", target_os = "android")), allow(dead_code))] + mod utils; use log::debug;