diff options
author | Ryan Zoeller <rtzoeller@rtzoeller.com> | 2022-10-08 13:48:59 -0500 |
---|---|---|
committer | Ryan Zoeller <rtzoeller@rtzoeller.com> | 2022-10-08 14:08:54 -0500 |
commit | 6e7bddd1540565a9da7f7e56ddf5851d1786a3dd (patch) | |
tree | 567db2ef31477eb0b6fa91e764e6bb780e672276 /src/sys/statfs.rs | |
parent | e5913c68a75474844b79663571086796ef932ba9 (diff) | |
download | nix-6e7bddd1540565a9da7f7e56ddf5851d1786a3dd.zip |
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.
Diffstat (limited to 'src/sys/statfs.rs')
-rw-r--r-- | src/sys/statfs.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sys/statfs.rs b/src/sys/statfs.rs index 8d2b283b..a1c1aaa9 100644 --- a/src/sys/statfs.rs +++ b/src/sys/statfs.rs @@ -705,6 +705,8 @@ mod test { assert_fs_equals(fs, vfs); } + // The cast is not unnecessary on all platforms. + #[allow(clippy::unnecessary_cast)] fn assert_fs_equals(fs: Statfs, vfs: Statvfs) { assert_eq!(fs.files() as u64, vfs.files() as u64); assert_eq!(fs.blocks() as u64, vfs.blocks() as u64); @@ -752,6 +754,8 @@ mod test { assert_fs_equals_strict(fs.unwrap(), vfs.unwrap()) } + // The cast is not unnecessary on all platforms. + #[allow(clippy::unnecessary_cast)] fn assert_fs_equals_strict(fs: Statfs, vfs: Statvfs) { assert_eq!(fs.files_free() as u64, vfs.files_free() as u64); assert_eq!(fs.blocks_free() as u64, vfs.blocks_free() as u64); |