summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Saveau <saveau.alexandre@gmail.com>2022-11-06 11:40:46 -0800
committerAlex Saveau <saveau.alexandre@gmail.com>2022-11-06 11:40:46 -0800
commit58f99947bfd069390dcfaa314b06d0e5ffb76c01 (patch)
tree4176ae77cbef54ff1ee13af5785d06242953fc2c
parent17833268cb3269d83766bcdb4d9cbe0e25ebd38e (diff)
downloadnix-58f99947bfd069390dcfaa314b06d0e5ffb76c01.zip
Run a round of clippy to fix CI
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
-rw-r--r--test/test_dir.rs2
-rw-r--r--test/test_fcntl.rs8
-rw-r--r--test/test_kmod/mod.rs4
-rw-r--r--test/test_unistd.rs8
4 files changed, 11 insertions, 11 deletions
diff --git a/test/test_dir.rs b/test/test_dir.rs
index f6629921..2af4aa5c 100644
--- a/test/test_dir.rs
+++ b/test/test_dir.rs
@@ -19,7 +19,7 @@ fn flags() -> OFlag {
#[allow(clippy::unnecessary_sort_by)] // False positive
fn read() {
let tmp = tempdir().unwrap();
- File::create(&tmp.path().join("foo")).unwrap();
+ File::create(tmp.path().join("foo")).unwrap();
std::os::unix::fs::symlink("foo", tmp.path().join("bar")).unwrap();
let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap();
let mut entries: Vec<_> = dir.iter().map(|e| e.unwrap()).collect();
diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs
index bc65b260..345e04da 100644
--- a/test/test_fcntl.rs
+++ b/test/test_fcntl.rs
@@ -64,7 +64,7 @@ fn test_renameat() {
let old_dirfd =
open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap();
let old_path = old_dir.path().join("old");
- File::create(&old_path).unwrap();
+ File::create(old_path).unwrap();
let new_dir = tempfile::tempdir().unwrap();
let new_dirfd =
open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap();
@@ -94,7 +94,7 @@ fn test_renameat2_behaves_like_renameat_with_no_flags() {
let old_dirfd =
open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap();
let old_path = old_dir.path().join("old");
- File::create(&old_path).unwrap();
+ File::create(old_path).unwrap();
let new_dir = tempfile::tempdir().unwrap();
let new_dirfd =
open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap();
@@ -186,12 +186,12 @@ fn test_renameat2_noreplace() {
let old_dirfd =
open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap();
let old_path = old_dir.path().join("old");
- File::create(&old_path).unwrap();
+ File::create(old_path).unwrap();
let new_dir = tempfile::tempdir().unwrap();
let new_dirfd =
open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap();
let new_path = new_dir.path().join("new");
- File::create(&new_path).unwrap();
+ File::create(new_path).unwrap();
assert_eq!(
renameat2(
Some(old_dirfd),
diff --git a/test/test_kmod/mod.rs b/test/test_kmod/mod.rs
index 5ebc2423..6f9aaa89 100644
--- a/test/test_kmod/mod.rs
+++ b/test/test_kmod/mod.rs
@@ -12,12 +12,12 @@ fn compile_kernel_module() -> (PathBuf, String, TempDir) {
copy(
"test/test_kmod/hello_mod/hello.c",
- &tmp_dir.path().join("hello.c"),
+ tmp_dir.path().join("hello.c"),
)
.expect("unable to copy hello.c to temporary build directory");
copy(
"test/test_kmod/hello_mod/Makefile",
- &tmp_dir.path().join("Makefile"),
+ tmp_dir.path().join("Makefile"),
)
.expect("unable to copy Makefile to temporary build directory");
diff --git a/test/test_unistd.rs b/test/test_unistd.rs
index 8ad6340c..9e20f977 100644
--- a/test/test_unistd.rs
+++ b/test/test_unistd.rs
@@ -903,7 +903,7 @@ fn test_linkat_file() {
let newfilepath = tempdir.path().join(newfilename);
// Create file
- File::create(&oldfilepath).unwrap();
+ File::create(oldfilepath).unwrap();
// Get file descriptor for base directory
let dirfd =
@@ -936,7 +936,7 @@ fn test_linkat_olddirfd_none() {
let newfilepath = tempdir_newfile.path().join(newfilename);
// Create file
- File::create(&oldfilepath).unwrap();
+ File::create(oldfilepath).unwrap();
// Get file descriptor for base directory of new file
let dirfd = fcntl::open(
@@ -973,7 +973,7 @@ fn test_linkat_newdirfd_none() {
let newfilepath = tempdir_newfile.path().join(newfilename);
// Create file
- File::create(&oldfilepath).unwrap();
+ File::create(oldfilepath).unwrap();
// Get file descriptor for base directory of old file
let dirfd = fcntl::open(
@@ -1101,7 +1101,7 @@ fn test_unlinkat_dir_noremovedir() {
let dirpath = tempdir.path().join(dirname);
// Create dir
- DirBuilder::new().recursive(true).create(&dirpath).unwrap();
+ DirBuilder::new().recursive(true).create(dirpath).unwrap();
// Get file descriptor for base directory
let dirfd =