summaryrefslogtreecommitdiffstats
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
parent7ff4cb3f4e236724d8bdf0d3a83258cd5daeb228 (diff)
clippy: fix warnings introduced by Rust 1.74
-rw-r--r--src/uu/more/src/more.rs2
-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
4 files changed, 8 insertions, 10 deletions
diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs
index 02ed0feea..b21b2ab1f 100644
--- a/src/uu/more/src/more.rs
+++ b/src/uu/more/src/more.rs
@@ -88,7 +88,7 @@ impl Options {
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args.collect_lossy();
- let matches = match uu_app().try_get_matches_from(&args) {
+ let matches = match uu_app().try_get_matches_from(args) {
Ok(m) => m,
Err(e) => return Err(e.into()),
};
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()