From 6e7bddd1540565a9da7f7e56ddf5851d1786a3dd Mon Sep 17 00:00:00 2001 From: Ryan Zoeller Date: Sat, 8 Oct 2022 13:48:59 -0500 Subject: Fix clippy warnings on nightly Clippy is now smarter about detecting unnecessary casts and useless conversions, which means we need to be more explicit about when the conversions are needed for a subset of platforms. Required changes found by repeatedly running the following command against a list of the supported platforms. `xargs -t -I {} sh -c "cargo clippy -Zbuild-std --target {} --all-targets -- -D warnings || exit 255"` I removed the casts it complained about, and then restored them with an `#[allow]` if a later target needed the cast. --- test/sys/test_ioctl.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/sys/test_ioctl.rs') diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs index 7a603c5b..40f60cfd 100644 --- a/test/sys/test_ioctl.rs +++ b/test/sys/test_ioctl.rs @@ -30,6 +30,8 @@ ioctl_readwrite_buf!(readwritebuf_test, 0, 0, u32); #[cfg(any(target_os = "linux", target_os = "android"))] mod linux { + // The cast is not unnecessary on all platforms. + #[allow(clippy::unnecessary_cast)] #[test] fn test_op_none() { if cfg!(any( @@ -46,6 +48,8 @@ mod linux { } } + // The cast is not unnecessary on all platforms. + #[allow(clippy::unnecessary_cast)] #[test] fn test_op_write() { if cfg!(any( @@ -78,6 +82,8 @@ mod linux { } } + // The cast is not unnecessary on all platforms. + #[allow(clippy::unnecessary_cast)] #[test] fn test_op_read() { if cfg!(any( @@ -110,6 +116,8 @@ mod linux { } } + // The cast is not unnecessary on all platforms. + #[allow(clippy::unnecessary_cast)] #[test] fn test_op_read_write() { assert_eq!(request_code_readwrite!(b'z', 10, 1) as u32, 0xC001_7A0A); -- cgit v1.2.3