Accept clippy suggestions
This commit is contained in:
@@ -475,13 +475,13 @@ pub fn add_worktree(
|
|||||||
let config = repo::read_worktree_root_config(directory)?;
|
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));
|
return Err(format!("Worktree {} already exists", &name));
|
||||||
}
|
}
|
||||||
|
|
||||||
let path = match subdirectory {
|
let path = match subdirectory {
|
||||||
Some(dir) => directory.join(dir).join(name),
|
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;
|
let mut remote_branch_exists = false;
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ impl Repo {
|
|||||||
|
|
||||||
pub fn find_worktree(&self, name: &str) -> Result<(), String> {
|
pub fn find_worktree(&self, name: &str) -> Result<(), String> {
|
||||||
self.0
|
self.0
|
||||||
.find_worktree(&name)
|
.find_worktree(name)
|
||||||
.map_err(convert_libgit2_error)?;
|
.map_err(convert_libgit2_error)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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!(
|
errors.push(format!(
|
||||||
"Found {}, which is not a valid worktree directory!",
|
"Found {}, which is not a valid worktree directory!",
|
||||||
&worktree
|
&worktree
|
||||||
|
|||||||
Reference in New Issue
Block a user