From e940ab69fb46bcdc13dc601b6ad856fc6cb688d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Tue, 10 May 2022 18:25:45 +0200 Subject: [PATCH] Accept clippy suggestions --- src/lib.rs | 4 ++-- src/repo.rs | 2 +- src/table.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0facb54..ccb84c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; diff --git a/src/repo.rs b/src/repo.rs index 33a0899..b56a0f1 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -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(()) } diff --git a/src/table.rs b/src/table.rs index b4a9814..fcea35f 100644 --- a/src/table.rs +++ b/src/table.rs @@ -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