diff --git a/src/history/add.rs b/src/history/add.rs index 9d4fd24..45a13b1 100644 --- a/src/history/add.rs +++ b/src/history/add.rs @@ -40,14 +40,14 @@ mod tests { println!("about to add"); add( &link, - &file_name, + file_name, &FileEnv::create(dir.path().to_string_lossy().to_string()), )?; println!("called add"); //then println!("about to read file contents"); - let content: Vec = read_text_file(&dir.path(), &file_name)?; + let content: Vec = read_text_file(dir.path(), file_name)?; println!("read file contents"); drop(dir); @@ -79,7 +79,7 @@ mod tests { )?; //then - let content: Vec = read_text_file(&dir.path(), &file_name)?; + let content: Vec = read_text_file(dir.path(), file_name)?; drop(dir); let expected = vec![ diff --git a/src/lib.rs b/src/lib.rs index 937efe5..67ceced 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,18 +87,14 @@ mod tests { open: mock_file_open(HashMap::from([ ( subs_file_name.to_string(), - format!( - "{}/{}", - subs_dir.path().to_string_lossy(), - subs_file_name.to_string() - ), + format!("{}/{}", subs_dir.path().to_string_lossy(), subs_file_name), ), ( history_file_name.to_string(), format!( "{}/{}", history_dir.path().to_string_lossy(), - history_file_name.to_string() + history_file_name ), ), ])), @@ -107,7 +103,7 @@ mod tests { }; //when - run(&subs_file_name, &history_file_name, site, env)?; + run(subs_file_name, history_file_name, site, env)?; //then drop(subs_dir); drop(history_dir); diff --git a/src/test_utils.rs b/src/test_utils.rs index a4e2b49..13569fd 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -20,7 +20,7 @@ pub fn create_text_file(name: &str, data: &[u8]) -> Result { let data = from_utf8(data)?; let dir = tempdir()?; let filename = format!("{}", &dir.path().join(name).display()); - let file = File::create(&filename)?; + let file = File::create(filename)?; write!(&file, "{data}")?; Ok(dir) }