From 8032c6d750f4a97b0d5880fc0180554f10360d8f Mon Sep 17 00:00:00 2001 From: Jan Scheer Date: Wed, 19 May 2021 01:04:24 +0200 Subject: [PATCH] fix clippy warnings --- src/uucore/src/lib/features/fsext.rs | 8 ++++---- tests/by-util/test_basename.rs | 2 ++ tests/by-util/test_relpath.rs | 6 +++--- tests/by-util/test_uname.rs | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs index 887c31e01..19c634b0b 100644 --- a/src/uucore/src/lib/features/fsext.rs +++ b/src/uucore/src/lib/features/fsext.rs @@ -276,7 +276,7 @@ impl MountInfo { GetVolumeInformationW( String2LPWSTR!(mount_root), ptr::null_mut(), - 0 as DWORD, + 0, ptr::null_mut(), ptr::null_mut(), ptr::null_mut(), @@ -510,12 +510,12 @@ impl FsUsage { // Total number of free blocks. bfree: number_of_free_clusters as u64, // Total number of free blocks available to non-privileged processes. - bavail: 0 as u64, + bavail: 0, bavail_top_bit_set: ((bytes_per_sector as u64) & (1u64.rotate_right(1))) != 0, // Total number of file nodes (inodes) on the file system. - files: 0 as u64, // Not available on windows + files: 0, // Not available on windows // Total number of free file nodes (inodes). - ffree: 4096 as u64, // Meaningless on Windows + ffree: 4096, // Meaningless on Windows } } } diff --git a/tests/by-util/test_basename.rs b/tests/by-util/test_basename.rs index 2a40ba4b9..baf15f78a 100644 --- a/tests/by-util/test_basename.rs +++ b/tests/by-util/test_basename.rs @@ -1,4 +1,5 @@ use crate::common::util::*; +#[cfg(any(unix, target_os = "redox"))] use std::ffi::OsStr; #[test] @@ -123,6 +124,7 @@ fn test_too_many_args_output() { ); } +#[cfg(any(unix, target_os = "redox"))] fn test_invalid_utf8_args(os_str: &OsStr) { let test_vec = vec![os_str.to_os_string()]; new_ucmd!().args(&test_vec).succeeds().stdout_is("fo�o\n"); diff --git a/tests/by-util/test_relpath.rs b/tests/by-util/test_relpath.rs index 5094d25a8..70d9f2a5d 100644 --- a/tests/by-util/test_relpath.rs +++ b/tests/by-util/test_relpath.rs @@ -155,7 +155,7 @@ fn test_relpath_no_from_with_d() { at.mkdir_all(to); // d is part of subpath -> expect relative path - let mut result_stdout = scene + let _result_stdout = scene .ucmd() .arg(to) .arg(&format!("-d{}", pwd)) @@ -163,10 +163,10 @@ fn test_relpath_no_from_with_d() { .stdout_move_str(); // relax rules for windows test environment #[cfg(not(windows))] - assert!(Path::new(&result_stdout).is_relative()); + assert!(Path::new(&_result_stdout).is_relative()); // d is not part of subpath -> expect absolut path - result_stdout = scene + let result_stdout = scene .ucmd() .arg(to) .arg("-dnon_existing") diff --git a/tests/by-util/test_uname.rs b/tests/by-util/test_uname.rs index da901d985..d878ed7ac 100644 --- a/tests/by-util/test_uname.rs +++ b/tests/by-util/test_uname.rs @@ -43,5 +43,5 @@ fn test_uname_kernel() { } #[cfg(not(target_os = "linux"))] - let result = ucmd.arg("-o").succeeds(); + ucmd.arg("-o").succeeds(); }