diff --git a/src/config.rs b/src/config.rs index 3c631af..5c588dd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -298,7 +298,7 @@ pub fn read_config<'a, T>(path: &str) -> Result where T: for<'de> serde::Deserialize<'de>, { - let content = match std::fs::read_to_string(&path) { + let content = match std::fs::read_to_string(path) { Ok(s) => s, Err(e) => { return Err(format!( diff --git a/src/lib.rs b/src/lib.rs index 0c17e62..cdfc596 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,7 +106,7 @@ fn find_repos(root: &Path) -> Result, Vec, bool) }, ) } else { - let name = path.strip_prefix(&root).unwrap(); + let name = path.strip_prefix(root).unwrap(); let namespace = name.parent().unwrap(); ( if namespace != Path::new("") { diff --git a/src/repo.rs b/src/repo.rs index 5080d42..2b3549d 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -785,7 +785,7 @@ impl RepoHandle { )) })?; - for entry in match std::fs::read_dir(&root_dir) { + for entry in match std::fs::read_dir(root_dir) { Ok(iterator) => iterator, Err(error) => { return Err(WorktreeConversionFailureReason::Error(format!( @@ -1343,7 +1343,7 @@ impl RepoHandle { }, }) { - let repo_dir = &directory.join(&worktree.name()); + let repo_dir = &directory.join(worktree.name()); if repo_dir.exists() { match self.remove_worktree( directory, @@ -1387,12 +1387,12 @@ impl RepoHandle { .map_err(|error| format!("Getting worktrees failed: {}", error))?; let mut unmanaged_worktrees = Vec::new(); - for entry in std::fs::read_dir(&directory).map_err(|error| error.to_string())? { + for entry in std::fs::read_dir(directory).map_err(|error| error.to_string())? { let dirname = path::path_as_string( entry .map_err(|error| error.to_string())? .path() - .strip_prefix(&directory) + .strip_prefix(directory) // that unwrap() is safe as each entry is // guaranteed to be a subentry of &directory .unwrap(), diff --git a/src/table.rs b/src/table.rs index cf07a86..0670ddd 100644 --- a/src/table.rs +++ b/src/table.rs @@ -111,7 +111,7 @@ pub fn get_worktree_status_table( add_worktree_table_header(&mut table); for worktree in &worktrees { - let worktree_dir = &directory.join(&worktree.name()); + let worktree_dir = &directory.join(worktree.name()); if worktree_dir.exists() { let repo = match repo::RepoHandle::open(worktree_dir, false) { Ok(repo) => repo,