summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-05-21 15:07:38 +0000
committerGitHub <noreply@github.com>2023-05-21 15:07:38 +0000
commitfe4af4bb0f066c3bd64a367fd66acd00a6e718f3 (patch)
tree389dc5b02b55b90b3af387c465f33ff1a16bf397
parentae6699940e8fc75008f94312f189892efdcfb2f0 (diff)
parente42c3589a3c17e69043bc76c9a087acf6e5cb83e (diff)
downloadnix-fe4af4bb0f066c3bd64a367fd66acd00a6e718f3.zip
Merge #2043
2043: Clippy cleanup: r=asomers a=asomers fix the new clippy::non_minimal_cfg lint Co-authored-by: Alan Somers <asomers@gmail.com>
-rw-r--r--src/fcntl.rs4
-rw-r--r--src/sys/socket/mod.rs2
-rw-r--r--src/sys/socket/sockopt.rs4
-rw-r--r--test/test_fcntl.rs4
4 files changed, 7 insertions, 7 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs
index a9ef9ad1..d799ff37 100644
--- a/src/fcntl.rs
+++ b/src/fcntl.rs
@@ -701,7 +701,7 @@ pub fn vmsplice(
}
}
-#[cfg(any(target_os = "linux"))]
+#[cfg(target_os = "linux")]
#[cfg(feature = "fs")]
libc_bitflags!(
/// Mode argument flags for fallocate determining operation performed on a given range.
@@ -741,7 +741,7 @@ feature! {
///
/// Allows the caller to directly manipulate the allocated disk space for the
/// file referred to by fd.
-#[cfg(any(target_os = "linux"))]
+#[cfg(target_os = "linux")]
#[cfg(feature = "fs")]
pub fn fallocate(
fd: RawFd,
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index 9b6f18ef..1e3438ea 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -236,7 +236,7 @@ impl SockProtocol {
#[allow(non_upper_case_globals)]
pub const CanBcm: SockProtocol = SockProtocol::NetlinkUserSock; // Matches libc::CAN_BCM
}
-#[cfg(any(target_os = "linux"))]
+#[cfg(target_os = "linux")]
libc_bitflags! {
/// Configuration flags for `SO_TIMESTAMPING` interface
///
diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs
index a18b5905..d5bcda4c 100644
--- a/src/sys/socket/sockopt.rs
+++ b/src/sys/socket/sockopt.rs
@@ -683,7 +683,7 @@ sockopt_impl!(
libc::IP6T_SO_ORIGINAL_DST,
libc::sockaddr_in6
);
-#[cfg(any(target_os = "linux"))]
+#[cfg(target_os = "linux")]
sockopt_impl!(
/// Specifies exact type of timestamping information collected by the kernel
/// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html)
@@ -702,7 +702,7 @@ sockopt_impl!(
libc::SO_TIMESTAMP,
bool
);
-#[cfg(all(target_os = "linux"))]
+#[cfg(target_os = "linux")]
sockopt_impl!(
/// Enable or disable the receiving of the `SO_TIMESTAMPNS` control message.
ReceiveTimestampns,
diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs
index 8f50f16b..de502d1a 100644
--- a/test/test_fcntl.rs
+++ b/test/test_fcntl.rs
@@ -238,7 +238,7 @@ mod linux_android {
use nix::unistd::{close, pipe, read, write};
use tempfile::tempfile;
- #[cfg(any(target_os = "linux"))]
+ #[cfg(target_os = "linux")]
use tempfile::NamedTempFile;
use crate::*;
@@ -355,7 +355,7 @@ mod linux_android {
close(wr).unwrap();
}
- #[cfg(any(target_os = "linux"))]
+ #[cfg(target_os = "linux")]
#[test]
fn test_fallocate() {
let tmp = NamedTempFile::new().unwrap();