Skip to content

Commit 6b27d84

Browse files
committed
Adopt clippy suggestions
1 parent ca70930 commit 6b27d84

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

src/find_projects.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn projects_below<'a>(
1313
) -> impl Iterator<Item = Project> + 'a {
1414
let path = path.canonicalize().expect("canonicalized path");
1515

16-
WalkBuilder::new(&path)
16+
WalkBuilder::new(path)
1717
.standard_filters(true)
1818
// skip ignored directories even outside Git repositories
1919
.require_git(false)
@@ -87,7 +87,7 @@ mod test {
8787
let _ = OpenOptions::new()
8888
.create_new(true)
8989
.write(true)
90-
.open(&path.as_ref().join("projectfile"))
90+
.open(path.as_ref().join("projectfile"))
9191
.expect("creating the fake project");
9292
}
9393

@@ -169,7 +169,7 @@ mod test {
169169
hidden_dir.create_dir_all().unwrap();
170170
let hidden_dir_path = hidden_dir.path().canonicalize().unwrap();
171171

172-
fake_project_at(&hidden_dir_path);
172+
fake_project_at(hidden_dir_path);
173173
let projects: Vec<Project> =
174174
projects_below(&root_path, &project_filter(), &build_tool_manager()).collect();
175175

@@ -189,7 +189,7 @@ mod test {
189189
ignored_dir.create_dir_all().unwrap();
190190
let ignored_dir_path = ignored_dir.path().canonicalize().unwrap();
191191

192-
fake_project_at(&ignored_dir_path);
192+
fake_project_at(ignored_dir_path);
193193
let projects: Vec<Project> =
194194
projects_below(&root_path, &project_filter(), &build_tool_manager()).collect();
195195

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub fn clean(cli: Cli, build_tool_manager: BuildToolManager) -> anyhow::Result<(
236236

237237
fn theme() -> Box<dyn Theme> {
238238
if colors_enabled() {
239-
Box::new(ColorfulTheme::default())
239+
Box::<ColorfulTheme>::default()
240240
} else {
241241
Box::new(SimpleTheme {})
242242
}

src/project/archive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl Project {
5757
tempdir.close()?;
5858

5959
// Remove the project's contents
60-
fs::remove_dir_all(&renamed_project_path)?;
60+
fs::remove_dir_all(renamed_project_path)?;
6161

6262
Ok(final_tar_xz_path)
6363
}

src/project/vcs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ mod test {
9393
level1_ignored_dir.create_dir_all()?;
9494

9595
root.child(".gitignore").write_str("/foo/ignored_dir")?;
96-
let _ = Repository::init(&root.path())?;
96+
let _ = Repository::init(root.path())?;
9797

9898
// We operate in the "foo" subdirectory
9999
let vcs = VersionControlSystem::try_from(&path_of(&level0_foo))

tests/tests/archive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn archive_cleans_then_packs_includes_hidden_files_then_removes_project_files()
5555
// Let's use a new temporary directory for this..
5656
let extract_root = TempDir::new()?;
5757

58-
let tar_xz = File::open(&project_dir.join(fname)).unwrap();
58+
let tar_xz = File::open(project_dir.join(fname)).unwrap();
5959
let tar = XzDecoder::new(tar_xz);
6060
let mut archive = tar::Archive::new(tar);
6161
archive.unpack(extract_root.path()).unwrap();
@@ -119,7 +119,7 @@ fn any_projects_within_a_to_be_archived_project_are_only_cleaned_but_not_archive
119119

120120
// Extract the result:
121121
let extract_root = TempDir::new()?;
122-
let tar_xz = File::open(&project_dir.join("cargo_test_project.tar.xz")).unwrap();
122+
let tar_xz = File::open(project_dir.join("cargo_test_project.tar.xz")).unwrap();
123123
let tar = XzDecoder::new(tar_xz);
124124
let mut archive = tar::Archive::new(tar);
125125
archive.unpack(extract_root.path()).unwrap();

tests/tests/list.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn directories_ignored_by_git_are_not_considered() -> Result<()> {
5353

5454
// Only the project in `normal_dir` is returned:
5555
let project: ProjectDto = serde_json::from_str(output.trim()).unwrap();
56-
assert_eq!(project.path, canonicalized_str(&root.join("normal_dir")));
56+
assert_eq!(project.path, canonicalized_str(root.join("normal_dir")));
5757

5858
Ok(())
5959
}
@@ -86,10 +86,10 @@ fn subprojects_are_discovered() -> Result<()> {
8686
);
8787
assert!(projects
8888
.iter()
89-
.any(|p| p.path == canonicalized_str(&root.path()) && p.build_tools == vec!["Cargo"]));
89+
.any(|p| p.path == canonicalized_str(root.path()) && p.build_tools == vec!["Cargo"]));
9090
assert!(projects
9191
.iter()
92-
.any(|p| p.path == canonicalized_str(&root.join("web")) && p.build_tools == vec!["NPM"]));
92+
.any(|p| p.path == canonicalized_str(root.join("web")) && p.build_tools == vec!["NPM"]));
9393

9494
Ok(())
9595
}
@@ -244,10 +244,10 @@ fn accepts_multiple_directories_as_input_and_deduplicates_by_path() -> Result<()
244244
);
245245
assert!(projects
246246
.iter()
247-
.any(|p| p.path == canonicalized_str(&project_dir_1.path())));
247+
.any(|p| p.path == canonicalized_str(project_dir_1.path())));
248248
assert!(projects
249249
.iter()
250-
.any(|p| p.path == canonicalized_str(&project_dir_2.path())));
250+
.any(|p| p.path == canonicalized_str(project_dir_2.path())));
251251

252252
Ok(())
253253
}

tests/util/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ where
1515
T: PathChild + AsRef<Path>,
1616
{
1717
fs::create_dir_all(parent.as_ref()).unwrap();
18-
let repo = Repository::init(&parent).unwrap();
18+
let repo = Repository::init(parent).unwrap();
1919

2020
if !gitignore.is_empty() {
2121
let gitignore_path = parent.child(".gitignore");

0 commit comments

Comments
 (0)