Accept clippy suggestions

This commit is contained in:
2022-05-10 18:25:45 +02:00
parent 1cf4e85014
commit e940ab69fb
3 changed files with 4 additions and 4 deletions

View File

@@ -475,13 +475,13 @@ pub fn add_worktree(
let config = repo::read_worktree_root_config(directory)?;
if repo.find_worktree(&name).is_ok() {
if repo.find_worktree(name).is_ok() {
return Err(format!("Worktree {} already exists", &name));
}
let path = match subdirectory {
Some(dir) => directory.join(dir).join(name),
None => directory.join(Path::new(name).to_path_buf()),
None => directory.join(Path::new(name)),
};
let mut remote_branch_exists = false;

View File

@@ -674,7 +674,7 @@ impl Repo {
pub fn find_worktree(&self, name: &str) -> Result<(), String> {
self.0
.find_worktree(&name)
.find_worktree(name)
.map_err(convert_libgit2_error)?;
Ok(())
}

View File

@@ -132,7 +132,7 @@ pub fn get_worktree_status_table(
));
}
}
for worktree in Repo::find_unmanaged_worktrees(&repo, &directory).unwrap() {
for worktree in Repo::find_unmanaged_worktrees(repo, directory).unwrap() {
errors.push(format!(
"Found {}, which is not a valid worktree directory!",
&worktree