Fix clippy warnings in tests

This commit is contained in:
Daniel Hofstetter 2022-08-12 09:45:16 +02:00
parent bfa6e23166
commit dd19f85d2b
2 changed files with 4 additions and 4 deletions

View file

@ -404,8 +404,8 @@ fn test_with_pr_core_utils_tests() {
for test_case in test_cases {
let (flags, input_file, expected_file, return_code) = test_case;
let mut scenario = new_ucmd!();
let input_file_path = input_file.get(0).unwrap();
let test_file_path = expected_file.get(0).unwrap();
let input_file_path = input_file.first().unwrap();
let test_file_path = expected_file.first().unwrap();
let value = file_last_modified_time(&scenario, test_file_path);
let mut arguments: Vec<&str> = flags
.split(' ')

View file

@ -982,7 +982,7 @@ impl UCommand {
tmpd: Rc<TempDir>,
env_clear: bool,
) -> Self {
let tmpd_path_buf = String::from(&(*tmpd.as_ref().path().to_str().unwrap()));
let tmpd_path_buf = String::from(tmpd.as_ref().path().to_str().unwrap());
let mut ucmd: Self = Self::new(bin_path, util_name, tmpd_path_buf, env_clear);
ucmd.tmpd = Some(tmpd);
ucmd
@ -1296,7 +1296,7 @@ pub fn check_coreutil_version(
std::str::from_utf8(&version_check.stdout).unwrap()
.split('\n')
.collect::<Vec<_>>()
.get(0)
.first()
.map_or_else(
|| Err(format!("{}: unexpected output format for reference coreutil: '{} --version'", UUTILS_WARNING, util_name)),
|s| {