mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
fix clippy warnings
This commit is contained in:
parent
cacd078a49
commit
8032c6d750
4 changed files with 10 additions and 8 deletions
|
@ -276,7 +276,7 @@ impl MountInfo {
|
||||||
GetVolumeInformationW(
|
GetVolumeInformationW(
|
||||||
String2LPWSTR!(mount_root),
|
String2LPWSTR!(mount_root),
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
0 as DWORD,
|
0,
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
ptr::null_mut(),
|
ptr::null_mut(),
|
||||||
|
@ -510,12 +510,12 @@ impl FsUsage {
|
||||||
// Total number of free blocks.
|
// Total number of free blocks.
|
||||||
bfree: number_of_free_clusters as u64,
|
bfree: number_of_free_clusters as u64,
|
||||||
// Total number of free blocks available to non-privileged processes.
|
// 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,
|
bavail_top_bit_set: ((bytes_per_sector as u64) & (1u64.rotate_right(1))) != 0,
|
||||||
// Total number of file nodes (inodes) on the file system.
|
// 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).
|
// Total number of free file nodes (inodes).
|
||||||
ffree: 4096 as u64, // Meaningless on Windows
|
ffree: 4096, // Meaningless on Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::common::util::*;
|
use crate::common::util::*;
|
||||||
|
#[cfg(any(unix, target_os = "redox"))]
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
|
|
||||||
#[test]
|
#[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) {
|
fn test_invalid_utf8_args(os_str: &OsStr) {
|
||||||
let test_vec = vec![os_str.to_os_string()];
|
let test_vec = vec![os_str.to_os_string()];
|
||||||
new_ucmd!().args(&test_vec).succeeds().stdout_is("fo<EFBFBD>o\n");
|
new_ucmd!().args(&test_vec).succeeds().stdout_is("fo<EFBFBD>o\n");
|
||||||
|
|
|
@ -155,7 +155,7 @@ fn test_relpath_no_from_with_d() {
|
||||||
at.mkdir_all(to);
|
at.mkdir_all(to);
|
||||||
|
|
||||||
// d is part of subpath -> expect relative path
|
// d is part of subpath -> expect relative path
|
||||||
let mut result_stdout = scene
|
let _result_stdout = scene
|
||||||
.ucmd()
|
.ucmd()
|
||||||
.arg(to)
|
.arg(to)
|
||||||
.arg(&format!("-d{}", pwd))
|
.arg(&format!("-d{}", pwd))
|
||||||
|
@ -163,10 +163,10 @@ fn test_relpath_no_from_with_d() {
|
||||||
.stdout_move_str();
|
.stdout_move_str();
|
||||||
// relax rules for windows test environment
|
// relax rules for windows test environment
|
||||||
#[cfg(not(windows))]
|
#[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
|
// d is not part of subpath -> expect absolut path
|
||||||
result_stdout = scene
|
let result_stdout = scene
|
||||||
.ucmd()
|
.ucmd()
|
||||||
.arg(to)
|
.arg(to)
|
||||||
.arg("-dnon_existing")
|
.arg("-dnon_existing")
|
||||||
|
|
|
@ -43,5 +43,5 @@ fn test_uname_kernel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
let result = ucmd.arg("-o").succeeds();
|
ucmd.arg("-o").succeeds();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue