Merge pull request #357 from hanbings/clippy

clippy: Fix clippy warning.
This commit is contained in:
Daniel Hofstetter
2024-04-23 07:41:54 +02:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -600,14 +600,14 @@ mod tests {
// modified time test
let modified_matcher = NewerTimeMatcher::new(NewerOptionType::Modified, time);
let mut buffer = [0; 10];
let buffer = [0; 10];
{
let mut file = OpenOptions::new()
.read(true)
.write(true)
.open(&foo_path)
.expect("open temp file");
let _ = file.write(&mut buffer);
let _ = file.write(&buffer);
}
assert!(
modified_matcher.matches(&file_info, &mut deps.new_matcher_io()),
+2 -2
View File
@@ -996,7 +996,7 @@ mod tests {
use std::{path::Path, process::Command};
let path = Path::new("./test_data/no_permission");
let _result = fs::create_dir(&path);
let _result = fs::create_dir(path);
// Generate files without permissions.
// std::fs cannot change file permissions to 000 in normal user state,
// so use chmod via Command to change permissions.
@@ -1016,7 +1016,7 @@ mod tests {
uucore::error::set_exit_code(0);
if path.exists() {
let _result = fs::create_dir(&path);
let _result = fs::create_dir(path);
// Remove the unreadable and writable status of the file to avoid affecting other tests.
let _output = Command::new("chmod")
.arg("+rwx")