Skip to content

Commit 79e370d

Browse files
committed
clippy: fix redundant_clone lint warnings in tests
1 parent f2ffb78 commit 79e370d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

tests/by-util/test_chown.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ fn test_chown_fail_id() {
471471
#[test]
472472
fn test_chown_only_user_id_nonexistent_user() {
473473
let ts = TestScenario::new(util_name!());
474-
let at = ts.fixtures.clone();
474+
let at = ts.fixtures;
475475
at.touch("f");
476476
if let Ok(result) = run_ucmd_as_root(&ts, &["12345", "f"]) {
477477
result.success().no_stdout().no_stderr();
@@ -537,7 +537,7 @@ fn test_chown_only_group_id() {
537537
#[test]
538538
fn test_chown_only_group_id_nonexistent_group() {
539539
let ts = TestScenario::new(util_name!());
540-
let at = ts.fixtures.clone();
540+
let at = ts.fixtures;
541541
at.touch("f");
542542
if let Ok(result) = run_ucmd_as_root(&ts, &[":12345", "f"]) {
543543
result.success().no_stdout().no_stderr();

tests/by-util/test_chroot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn test_chroot_skip_chdir_not_root() {
165165
#[test]
166166
fn test_chroot_skip_chdir() {
167167
let ts = TestScenario::new(util_name!());
168-
let at = ts.fixtures.clone();
168+
let at = ts.fixtures;
169169
let dirs = ["/", "/.", "/..", "isroot"];
170170
at.symlink_file("/", "isroot");
171171
for dir in dirs {

tests/by-util/test_env.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#[cfg(target_os = "linux")]
88
use crate::common::util::expected_result;
99
use crate::common::util::TestScenario;
10-
use ::env::native_int_str::{Convert, NCvt};
10+
use env::native_int_str::{Convert, NCvt};
1111
use regex::Regex;
1212
use std::env;
1313
use std::path::Path;
@@ -475,8 +475,8 @@ fn test_gnu_e20() {
475475

476476
#[test]
477477
fn test_split_string_misc() {
478-
use ::env::native_int_str::NCvt;
479-
use ::env::parse_args_from_str;
478+
use env::native_int_str::NCvt;
479+
use env::parse_args_from_str;
480480

481481
assert_eq!(
482482
NCvt::convert(vec!["A=B", "FOO=AR", "sh", "-c", "echo $A$FOO"]),
@@ -692,7 +692,7 @@ fn test_env_overwrite_arg0() {
692692
fn test_env_arg_argv0_overwrite() {
693693
let ts = TestScenario::new(util_name!());
694694

695-
let bin = ts.bin_path.clone();
695+
let bin = ts.bin_path;
696696

697697
// overwrite --argv0 by --argv0
698698
ts.ucmd()
@@ -740,7 +740,7 @@ fn test_env_arg_argv0_overwrite() {
740740
fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
741741
let ts = TestScenario::new(util_name!());
742742

743-
let bin = ts.bin_path.clone();
743+
let bin = ts.bin_path;
744744

745745
// string arg following normal
746746
ts.ucmd()
@@ -916,8 +916,8 @@ mod tests_split_iterator {
916916

917917
use std::ffi::OsString;
918918

919-
use ::env::parse_error::ParseError;
920919
use env::native_int_str::{from_native_int_representation_owned, Convert, NCvt};
920+
use env::parse_error::ParseError;
921921

922922
fn split(input: &str) -> Result<Vec<OsString>, ParseError> {
923923
::env::split_iterator::split(&NCvt::convert(input)).map(|vec| {

tests/by-util/test_install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ fn test_target_file_ends_with_slash() {
16891689
#[test]
16901690
fn test_install_root_combined() {
16911691
let ts = TestScenario::new(util_name!());
1692-
let at = ts.fixtures.clone();
1692+
let at = ts.fixtures;
16931693
at.touch("a");
16941694
at.touch("c");
16951695

0 commit comments

Comments
 (0)