Skip to content

cleanup: remove an unnecessary borrow reported by Clippy 1.66 #908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/simple_op_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn upgrade_from_thrift(store_path: &Path) -> std::io::Result<()> {
// Find the current operation head(s) of the operation log
let op_heads_store_path = repo_path.join("op_heads");
let mut old_op_heads = HashSet::new();
for entry in fs::read_dir(&op_heads_store_path)? {
for entry in fs::read_dir(op_heads_store_path)? {
let basename = entry?.file_name();
let op_id_str = basename.to_str().unwrap();
if let Ok(op_id_bytes) = hex::decode(op_id_str) {
Expand Down
4 changes: 2 additions & 2 deletions lib/tests/test_bad_locking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn merge_directories(left: &Path, base: &Path, right: &Path, output: &Path) {
if child_left.is_dir() {
sub_dirs.push(base_name.to_os_string());
} else {
std::fs::copy(&child_left, &child_output).unwrap();
std::fs::copy(&child_left, child_output).unwrap();
}
}
// Walk the base and find files removed in the right side, then remove them in
Expand Down Expand Up @@ -75,7 +75,7 @@ fn merge_directories(left: &Path, base: &Path, right: &Path, output: &Path) {
} else if !child_base.exists() {
// This overwrites the left side if that's been written. That's fine, since the
// point of the test is that it should be okay for either side to win.
std::fs::copy(&child_right, &child_output).unwrap();
std::fs::copy(&child_right, child_output).unwrap();
}
}
// Do the merge in subdirectories
Expand Down
2 changes: 2 additions & 0 deletions lib/tests/test_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ fn test_snapshot_racy_timestamps(use_git: bool) {
let wc = test_workspace.workspace.working_copy_mut();
for i in 0..100 {
{
// https://github.com/rust-lang/rust-clippy/issues/9778
#[allow(clippy::needless_borrow)]
let mut file = OpenOptions::new()
.create(true)
.write(true)
Expand Down