Skip to content

Commit

Permalink
clippy: fix redundant_clone lint warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker committed Apr 17, 2024
1 parent f2ffb78 commit 79e370d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/by-util/test_chown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ fn test_chown_fail_id() {
#[test]
fn test_chown_only_user_id_nonexistent_user() {
let ts = TestScenario::new(util_name!());
let at = ts.fixtures.clone();
let at = ts.fixtures;
at.touch("f");
if let Ok(result) = run_ucmd_as_root(&ts, &["12345", "f"]) {
result.success().no_stdout().no_stderr();
Expand Down Expand Up @@ -537,7 +537,7 @@ fn test_chown_only_group_id() {
#[test]
fn test_chown_only_group_id_nonexistent_group() {
let ts = TestScenario::new(util_name!());
let at = ts.fixtures.clone();
let at = ts.fixtures;
at.touch("f");
if let Ok(result) = run_ucmd_as_root(&ts, &[":12345", "f"]) {
result.success().no_stdout().no_stderr();
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_chroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ fn test_chroot_skip_chdir_not_root() {
#[test]
fn test_chroot_skip_chdir() {
let ts = TestScenario::new(util_name!());
let at = ts.fixtures.clone();
let at = ts.fixtures;
let dirs = ["/", "/.", "/..", "isroot"];
at.symlink_file("/", "isroot");
for dir in dirs {
Expand Down
12 changes: 6 additions & 6 deletions tests/by-util/test_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#[cfg(target_os = "linux")]
use crate::common::util::expected_result;
use crate::common::util::TestScenario;
use ::env::native_int_str::{Convert, NCvt};
use env::native_int_str::{Convert, NCvt};
use regex::Regex;
use std::env;
use std::path::Path;
Expand Down Expand Up @@ -475,8 +475,8 @@ fn test_gnu_e20() {

#[test]
fn test_split_string_misc() {
use ::env::native_int_str::NCvt;
use ::env::parse_args_from_str;
use env::native_int_str::NCvt;
use env::parse_args_from_str;

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

let bin = ts.bin_path.clone();
let bin = ts.bin_path;

// overwrite --argv0 by --argv0
ts.ucmd()
Expand Down Expand Up @@ -740,7 +740,7 @@ fn test_env_arg_argv0_overwrite() {
fn test_env_arg_argv0_overwrite_mixed_with_string_args() {
let ts = TestScenario::new(util_name!());

let bin = ts.bin_path.clone();
let bin = ts.bin_path;

// string arg following normal
ts.ucmd()
Expand Down Expand Up @@ -916,8 +916,8 @@ mod tests_split_iterator {

use std::ffi::OsString;

use ::env::parse_error::ParseError;
use env::native_int_str::{from_native_int_representation_owned, Convert, NCvt};
use env::parse_error::ParseError;

fn split(input: &str) -> Result<Vec<OsString>, ParseError> {
::env::split_iterator::split(&NCvt::convert(input)).map(|vec| {
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ fn test_target_file_ends_with_slash() {
#[test]
fn test_install_root_combined() {
let ts = TestScenario::new(util_name!());
let at = ts.fixtures.clone();
let at = ts.fixtures;
at.touch("a");
at.touch("c");

Expand Down

0 comments on commit 79e370d

Please sign in to comment.