summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Hofstetter <daniel.hofstetter@42dh.com>2023-11-16 16:02:38 +0100
committerDaniel Hofstetter <daniel.hofstetter@42dh.com>2023-11-16 16:21:28 +0100
commit2f9fcf73faad9d60db6f08c2e9ecd57fa845b0bd (patch)
tree45be462feb3f099672dc49b6186777a399228381 /tests
parent7ff4cb3f4e236724d8bdf0d3a83258cd5daeb228 (diff)
clippy: fix warnings introduced by Rust 1.74
Diffstat (limited to 'tests')
-rw-r--r--tests/by-util/test_dd.rs4
-rw-r--r--tests/by-util/test_ls.rs6
-rw-r--r--tests/by-util/test_users.rs6
3 files changed, 7 insertions, 9 deletions
diff --git a/tests/by-util/test_dd.rs b/tests/by-util/test_dd.rs
index f560e3526..d5ac8dc80 100644
--- a/tests/by-util/test_dd.rs
+++ b/tests/by-util/test_dd.rs
@@ -1470,7 +1470,7 @@ fn test_seek_output_fifo() {
.args(&["count=0", "seek=1", "of=fifo", "status=noxfer"])
.run_no_wait();
- std::fs::write(at.plus("fifo"), &vec![0; 512]).unwrap();
+ std::fs::write(at.plus("fifo"), vec![0; 512]).unwrap();
child
.wait()
@@ -1492,7 +1492,7 @@ fn test_skip_input_fifo() {
.args(&["count=0", "skip=1", "if=fifo", "status=noxfer"])
.run_no_wait();
- std::fs::write(at.plus("fifo"), &vec![0; 512]).unwrap();
+ std::fs::write(at.plus("fifo"), vec![0; 512]).unwrap();
child
.wait()
diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs
index cdd0292e1..07ea8c9cd 100644
--- a/tests/by-util/test_ls.rs
+++ b/tests/by-util/test_ls.rs
@@ -994,9 +994,9 @@ fn test_ls_long() {
fn test_ls_long_format() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
- at.mkdir(&at.plus_as_string("test-long-dir"));
+ at.mkdir(at.plus_as_string("test-long-dir"));
at.touch(at.plus_as_string("test-long-dir/test-long-file"));
- at.mkdir(&at.plus_as_string("test-long-dir/test-long-dir"));
+ at.mkdir(at.plus_as_string("test-long-dir/test-long-dir"));
for arg in LONG_ARGS {
// Assuming sane username do not have spaces within them.
@@ -1971,7 +1971,7 @@ fn test_ls_color() {
.join("nested_dir")
.to_string_lossy()
.to_string();
- at.mkdir(&nested_dir);
+ at.mkdir(nested_dir);
at.mkdir("z");
let nested_file = Path::new("a")
.join("nested_file")
diff --git a/tests/by-util/test_users.rs b/tests/by-util/test_users.rs
index 766378a9d..3d87aa9d0 100644
--- a/tests/by-util/test_users.rs
+++ b/tests/by-util/test_users.rs
@@ -21,11 +21,9 @@ fn test_users_check_name() {
#[cfg(target_os = "linux")]
let util_name = util_name!();
#[cfg(target_vendor = "apple")]
- let util_name = format!("g{}", util_name!());
+ let util_name = &format!("g{}", util_name!());
- // note: clippy::needless_borrow *false positive*
- #[allow(clippy::needless_borrow)]
- let expected = TestScenario::new(&util_name)
+ let expected = TestScenario::new(util_name)
.cmd(util_name)
.env("LC_ALL", "C")
.succeeds()